Created
August 7, 2025 21:46
-
-
Save blaisep/1d4b954ba282a11d511f0a708689aa0a to your computer and use it in GitHub Desktop.
Example: using ARA inside a GitHub Action
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: antsibull-build tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out antsibull | |
| uses: actions/checkout@v2 | |
| - name: Set up Python 3.9 | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: 3.9 | |
| - name: Install dependencies | |
| run: | | |
| python3 -m pip install --user --upgrade pip | |
| python3 -m pip install --user poetry ansible-core ara | |
| - name: Test building a release with the defaults | |
| shell: bash | |
| env: | |
| ARA_API_CLIENT: http | |
| ARA_API_SERVER: https://demo.recordsansible.org | |
| ARA_API_USERNAME: ${{ secrets.ARA_API_USERNAME }} | |
| ARA_API_PASSWORD: "${{ secrets.ARA_API_PASSWORD }}" | |
| ARA_CALLBACK_THREADS: 4 | |
| # https://docs.github.com/en/actions/learn-github-actions/contexts#github-context | |
| ARA_DEFAULT_LABELS: >- | |
| repository:${{ github.repository }},pr:${{ github.event.number }},ref:${{ github.ref }},sha:${{ github.sha }} | |
| run: | | |
| export ANSIBLE_CALLBACK_PLUGINS=$(python3 -m ara.setup.callback_plugins) | |
| ansible-playbook -vv playbooks/build-single-release.yaml | |
| - name: Combine and upload coverage stats | |
| run: | | |
| poetry run coverage combine .coverage.* | |
| poetry run coverage report | |
| poetry run coverage xml -i | |
| poetry run codecov |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment