perf(molecule): run scenarios in parallel, enable pipelining #98
Workflow file for this run
This file contains hidden or 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: Molecule | |
| # Containerised converge + idempotence + verify for the decdn_node role. | |
| # Heavy (privileged systemd Docker container) — scoped to ansible/ changes and | |
| # blocking. Mark it a required status check in branch protection once proven. | |
| on: | |
| pull_request: | |
| paths: ['ansible/**'] | |
| push: | |
| branches: [main] | |
| paths: ['ansible/**'] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: molecule-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| molecule: | |
| runs-on: ubuntu-latest # Docker is preinstalled | |
| defaults: | |
| run: | |
| working-directory: ansible | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: '3.12' | |
| - name: Install molecule + Ansible | |
| run: | | |
| python -m pip install --upgrade \ | |
| molecule "molecule-plugins[docker]" ansible ansible-lint docker | |
| - name: molecule test | |
| # `make molecule` runs every scenario under ansible/molecule/ and fans them out | |
| # in parallel; ansible/Makefile documents the set and the fail-loud guards. | |
| # | |
| # There is deliberately no separate `make deps` step: the molecule targets take | |
| # `deps` as a prerequisite, so a standalone one would resolve and install the | |
| # Galaxy requirements a second time every run — a second chance to trip over a | |
| # flaky galaxy.ansible.com, for no added coverage. | |
| # | |
| # JOBS is capped at 3 rather than the default (one job per scenario, currently | |
| # 6): every scenario is a privileged systemd container, and they share this | |
| # runner's cores and cgroup hierarchy. If this job turns flaky, drop to JOBS=1 | |
| # or swap in `make molecule-serial` — the latter also serialises the output. | |
| run: make molecule JOBS=3 |