Add CI and inspire other playbook #30
Workflow file for this run
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: End2end | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
paths: | |
- 'roles/**' | |
workflow_dispatch: | |
jobs: | |
integration: | |
name: Integration | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: ['macos-latest'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Uninstall GitHub Actions built-in Homebrew | |
run: ./tests/uninstall-homebrew.sh | |
- name: Uninstall GitHub Actions' built-in browser installs | |
run: | | |
sudo rm -rf /Applications/Firefox.app | |
sudo rm -rf /Applications/Google\ Chrome.app | |
sudo rm -rf /usr/local/bin/firefox | |
- name: Install test dependencies | |
run: | | |
cp -f tests/config.yml ./config.yml | |
pip install --upgrade pip | |
pip install -r requirements.txt | |
ansible-galaxy install -r requirements.yml | |
- name: Test the playbook | |
run: ansible-playbook -i hosts macinstall.yml | |
env: | |
ANSIBLE_FORCE_COLOR: '1' | |
- name: Idempotence check | |
run: | | |
idempotence=$(mktemp) | |
ansible-playbook -i hosts macinstall.yml | tee -a ${idempotence} | |
tail ${idempotence} | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1) | |
env: | |
ANSIBLE_FORCE_COLOR: '1' |