Fixing github action #36
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
--- | |
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the codebase. | |
uses: actions/checkout@v3 | |
- name: Set up Python 3. | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: Install test dependencies. | |
run: pip3 install yamllint ansible-base ansible-lint | |
- name: Lint yaml. | |
run: yamllint . | |
- name: Lint ansible | |
run: ansible-lint | |
integration: | |
name: Integration | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the codebase. | |
uses: actions/checkout@v3 | |
- name: Running installation | |
run: ./install.sh | |
- name: Test for idempotence | |
run: | | |
trace_file=$(mktemp) | |
./install.sh | tee -a ${trace_file} | |
tail ${trace_file} \ | |
| grep -q 'changed=0.*failed=0' \ | |
&& (echo 'Idempotence test: pass' && exit 0) \ | |
|| (echo 'Idempotence test: fail' && exit 1) |