Skip to content

CI

CI #255

Workflow file for this run

---
name: CI
on:
pull_request:
push:
branches:
- main
schedule:
- cron: "0 5 * * 4"
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v4
- name: Set up Python 3.
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install test dependencies.
run: |
pip3 install yamllint ansible ansible-lint
ansible-galaxy install --role-file requirements.yaml -v
- name: Lint yaml and ansible files.
run: make yaml-lint
integration:
name: integration
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-13
- macos-14
steps:
- name: Check out the codebase.
uses: actions/checkout@v4
- name: Uninstall GitHub Actions' built-in Homebrew.
run: tests/ci/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
- name: Install test dependencies.
run: |
sudo python3 -m pip install -U pip
sudo python3 -m pip install -U ansible ansible-core pexpect setuptools
- name: Set up the test environment.
run: |
cp tests/ci/darwin.config.yaml ./config.yaml
ansible-galaxy install --role-file requirements.yaml -v
- name: Test the playbook's syntax.
run: ansible-playbook main.yaml --syntax-check --skip-tags git
- name: Test the playbook.
run: ansible-playbook main.yaml --skip-tags git -v
env:
ANSIBLE_FORCE_COLOR: "1"
- name: Idempotence check.
run: |
idempotence=$(mktemp)
ansible-playbook main.yaml --skip-tags git -v | 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"