Merge pull request #100 from rashed-k/feature/added-cmdb-diff #204
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: Run ansible-test | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
ansible-test: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
python-version: [ '3.8', '3.9', '3.10', '3.11' ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
path: 'ansible_collections/lagoon' | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Install dependencies | |
run: python -m pip install ansible pytest pytest-forked | |
- name: Run unit tests | |
run: ansible-test units -v --requirements --python ${{ matrix.python-version }} | |
working-directory: ./ansible_collections/lagoon/api | |
- name: Publish test report | |
uses: mikepenz/action-junit-report@v3 | |
if: always() | |
with: | |
check_name: ansible-test (${{ matrix.python-version }}) results | |
report_paths: 'ansible_collections/lagoon/api/tests/output/junit/*.xml' | |
detailed_summary: true | |
- name: Upload test results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test-results-${{ matrix.python-version }} | |
path: ansible_collections/lagoon/api/tests/output/junit/*.xml | |
# Use always() to publish test results even when there are failures. | |
if: ${{ always() }} |