-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from markosamuli/feature/v2
Support for RedHat-based systems and latest Ansible versions
- Loading branch information
Showing
40 changed files
with
1,026 additions
and
474 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
--- | ||
exclude_paths: | ||
- .travis.yml | ||
- .travis.yml | ||
- .ansible-lint | ||
- .github/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
--- | ||
name: Test and release | ||
|
||
# This workflow is triggered on pushes to the repository. | ||
on: | ||
pull_request: | ||
branches: | ||
- "**" | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- v.* | ||
|
||
jobs: | ||
lint: | ||
name: Lint with pre-commit | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18" | ||
|
||
- uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.11" | ||
|
||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: "1.19" | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip3 install pre-commit | ||
go install mvdan.cc/sh/v3/cmd/shfmt@latest | ||
sudo apt-get install -y shellcheck | ||
python --version | ||
shfmt -version | ||
shellcheck --version | ||
pre-commit --version | ||
- name: Cache pre-commit dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pre-commit/ | ||
# yamllint disable-line rule:line-length | ||
key: ${{ runner.os }}-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pre-commit- | ||
- name: Run pre-commit | ||
run: pre-commit run -a | ||
|
||
ubuntu: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
distrib: [ubuntu] | ||
release: [focal, jammy, bionic] | ||
|
||
name: Test on ${{ matrix.distrib }}:${{ matrix.release }} | ||
env: | ||
DISTRIB: ${{ matrix.distrib }} | ||
RELEASE: ${{ matrix.release }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Run tests on ${{ matrix.distrib }}:${{ matrix.release }} | ||
run: ./tests/run-tests ${DISTRIB}-${RELEASE} | ||
|
||
debian: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
distrib: [debian] | ||
release: [bullseye, buster] | ||
|
||
name: Test on ${{ matrix.distrib }}:${{ matrix.release }} | ||
env: | ||
DISTRIB: ${{ matrix.distrib }} | ||
RELEASE: ${{ matrix.release }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Run tests on ${{ matrix.distrib }}:${{ matrix.release }} | ||
run: ./tests/run-tests ${DISTRIB}-${RELEASE} | ||
|
||
fedora: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
distrib: [fedora] | ||
release: [37] | ||
|
||
name: Test on ${{ matrix.distrib }}:${{ matrix.release }} | ||
env: | ||
DISTRIB: ${{ matrix.distrib }} | ||
RELEASE: ${{ matrix.release }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Run tests on ${{ matrix.distrib }}:${{ matrix.release }} | ||
run: ./tests/run-tests ${DISTRIB}-${RELEASE} | ||
|
||
release: | ||
name: Publish tagged releases to Ansible Galaxy | ||
needs: | ||
- lint | ||
- ubuntu | ||
- debian | ||
- fedora | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
steps: | ||
- name: galaxy | ||
uses: robertdebock/[email protected] | ||
with: | ||
galaxy_api_key: ${{ secrets.galaxy_api_key }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,46 @@ | ||
# -*- mode: yaml -*- | ||
# vim:ts=2:sw=2:ai:si:syntax=yaml | ||
################################ | ||
# pre-commit hooks configuration | ||
################################ | ||
--- | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks.git | ||
rev: v2.2.3 | ||
rev: v4.4.0 | ||
hooks: | ||
- id: check-executables-have-shebangs | ||
- id: check-byte-order-marker | ||
- id: check-case-conflict | ||
- id: check-merge-conflict | ||
- id: trailing-whitespace | ||
args: ['--markdown-linebreak-ext=md'] | ||
args: ["--markdown-linebreak-ext=md"] | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
args: ['--fix=lf'] | ||
args: ["--fix=lf"] | ||
- id: check-yaml | ||
- id: pretty-format-json | ||
args: ['--autofix', '--indent=2', '--no-sort-keys'] | ||
args: ["--autofix", "--indent=2", "--no-sort-keys"] | ||
|
||
- repo: https://github.com/adrienverge/yamllint.git | ||
rev: v1.16.0 | ||
rev: v1.29.0 | ||
hooks: | ||
- id: yamllint | ||
|
||
- repo: https://github.com/ansible/ansible-lint.git | ||
rev: v4.1.0 | ||
rev: v6.13.1 | ||
hooks: | ||
- id: ansible-lint | ||
files: \.(yaml|yml)$ | ||
exclude: .github/workflows/pipeline.yml | ||
|
||
- repo: https://github.com/bemeurer/beautysh.git | ||
rev: '4.1' | ||
- repo: https://github.com/syntaqx/git-hooks | ||
rev: v0.0.17 | ||
hooks: | ||
- id: beautysh | ||
- id: shellcheck | ||
files: (tests/run-.*|tests/update)$ | ||
|
||
- repo: https://github.com/openstack-dev/bashate.git | ||
rev: '0.6.0' | ||
- repo: https://github.com/scop/pre-commit-shfmt | ||
rev: v3.6.0-1 | ||
hooks: | ||
- id: bashate | ||
- id: shfmt | ||
files: (tests/run-.*|tests/update)$ | ||
|
||
- repo: https://github.com/igorshubovych/markdownlint-cli.git | ||
rev: v0.17.0 | ||
rev: v0.33.0 | ||
hooks: | ||
- id: markdownlint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,40 @@ | ||
PRE_COMMIT_HOOKS=.git/hooks/pre-commit | ||
|
||
.DEFAULT_GOAL := help | ||
|
||
# Use VERBOSE=1 make <command> to get verbose output | ||
ifndef VERBOSE | ||
.SILENT: | ||
endif | ||
|
||
.PHONY: help | ||
help: ## print this help | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort -d | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
@echo "" | ||
$(MAKE) list-images | ||
|
||
PRE_COMMIT_HOOKS = .git/hooks/pre-commit | ||
|
||
TEST_IMAGES = $(shell ls tests/*/Dockerfile | xargs dirname | xargs basename) | ||
|
||
.PHONY: setup | ||
setup: $(PRE_COMMIT_HOOKS) | ||
|
||
.PHONY: test | ||
test: | ||
@./tests/run-tests | ||
test: ## run tests with all available Docker images | ||
./tests/run-tests | ||
|
||
.PHONY: list-images | ||
list-images: ## list available test images | ||
@echo "Available test images:" | ||
@for i in $(TEST_IMAGES); do echo "$$i" | awk '{printf "\033[36m%-30s\033[0m run tests with %s\n", $$1, $$1}'; done | ||
|
||
.PHONY: $(TEST_IMAGES) | ||
$(TEST_IMAGES): | ||
./tests/run-tests $@ | ||
|
||
.PHONY: lint | ||
lint: $(PRE_COMMIT_HOOKS) | ||
@pre-commit run -a | ||
pre-commit run -a | ||
|
||
$(PRE_COMMIT_HOOKS): | ||
@pre-commit install | ||
pre-commit install |
Oops, something went wrong.