diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..61d478e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +--- +name: CI + +on: + push: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + ansible-lint-rules: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: + - 2.7 + - 3.6 + - 3.7 + - 3.8 + - 3.9 + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install ansible-lint + run: | + python -m pip install --upgrade pip + pip install ansible==2.9.* ansible-lint==4.* + + - name: Run ansible-lint + run: | + if ansible-lint -R -r ./rules tests/positive/*.yml; then echo "Positive tests OK"; (exit 0); else if [ $? -eq 2 ]; then echo "Positive tests is failed"; (exit 1); else echo "You rules is broken"; (exit 1); fi; fi + if ansible-lint -R -r ./rules tests/negative/*.yml; then echo "Negative tests failed"; (exit 1); else if [ $? -eq 2 ]; then echo "Negative tests OK"; (exit 0); else echo "You rules is broken"; (exit 1); fi; fi diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6aea44d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: python -python: - - "2.7" - - "3.5" -# - "3.7" waiting for support in travis https://github.com/travis-ci/travis-ci/issues/9552 -install: - - pip install ansible-lint -script: - - if ansible-lint -R -r ./rules tests/positive/*.yml; then echo "Positive tests OK"; (exit 0); else if [ $? -eq 2 ]; then echo "Positive tests is failed"; (exit 1); else echo "You rules is broken"; (exit 1); fi; fi - - if ansible-lint -R -r ./rules tests/negative/*.yml; then echo "Negative tests failed"; (exit 1); else if [ $? -eq 2 ]; then echo "Negative tests OK"; (exit 0); else echo "You rules is broken"; (exit 1); fi; fi diff --git a/README.rst b/README.rst index c25f526..d28b687 100644 --- a/README.rst +++ b/README.rst @@ -4,7 +4,13 @@ Rules for ansible-lint |travisstatus| .. |travisstatus| image:: https://travis-ci.org/lean-delivery/ansible-lint-rules.svg?branch=master :target: https://travis-ci.org/lean-delivery/ansible-lint-rules -This is a rule set for `ansible-lint `_ . +.. |ansible-lint version| image:: https://img.shields.io/pypi/v/ansible-lint/4.3.7.svg + :target: https://pypi.org/project/ansible-lint/4.3.7 + +This is a rule set for `ansible-lint `_ |ansible-lint version| + +This rule set doesn't support ansible-lint version higher than 4.3.7 + How to use ----------------