| 1 |
--- |
| 2 |
|
| 3 |
|
| 4 |
name: Run tests for the cloud.google collection |
| 5 |
on: |
| 6 |
|
| 7 |
push: |
| 8 |
branches: |
| 9 |
- main |
| 10 |
- stable-* |
| 11 |
pull_request: |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
schedule: |
| 17 |
- cron: '0 6 * * *' |
| 18 |
|
| 19 |
concurrency: |
| 20 |
group: >- |
| 21 |
${{ github.workflow }}-${{ |
| 22 |
github.event.pull_request.number || github.sha |
| 23 |
}} |
| 24 |
cancel-in-progress: true |
| 25 |
|
| 26 |
jobs: |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
setup: |
| 34 |
runs-on: ubuntu-latest |
| 35 |
outputs: |
| 36 |
matrix: ${{ steps.set-matrix.outputs.matrix }} |
| 37 |
steps: |
| 38 |
- uses: actions/checkout@v4 |
| 39 |
- id: set-matrix |
| 40 |
run: | |
| 41 |
# yq reads the .yaml and outputs a clean, minified JSON string |
| 42 |
MATRIX_JSON=$(yq -o=json -I=0 .github/test-matrix.yaml) |
| 43 |
echo "matrix=$MATRIX_JSON" >> $GITHUB_OUTPUT |
| 44 |
|
| 45 |
sanity: |
| 46 |
name: Sanity (Ⓐ${{ matrix.ansible }} / Ⓟ${{ matrix.python }}) |
| 47 |
runs-on: ubuntu-latest |
| 48 |
needs: setup |
| 49 |
strategy: |
| 50 |
matrix: ${{ fromJson(needs.setup.outputs.matrix) }} |
| 51 |
continue-on-error: ${{ matrix.ansible == 'devel' || matrix.ansible == 'milestone' }} |
| 52 |
|
| 53 |
steps: |
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
- name: Perform sanity testing |
| 58 |
|
| 59 |
|
| 60 |
uses: ansible-community/ansible-test-gh-action@d3a8ec7a59694e25e210fcd44738910149537f0e |
| 61 |
with: |
| 62 |
ansible-core-version: ${{ matrix.ansible }} |
| 63 |
target-python-version: ${{ matrix.python }} |
| 64 |
testing-type: sanity |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
pull-request-change-detection: false |
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
units: |
| 81 |
name: Units (Ⓐ${{ matrix.ansible }} / Ⓟ${{ matrix.python }}) |
| 82 |
runs-on: ubuntu-latest |
| 83 |
needs: setup |
| 84 |
strategy: |
| 85 |
matrix: ${{ fromJson(needs.setup.outputs.matrix) }} |
| 86 |
continue-on-error: ${{ matrix.ansible == 'devel' || matrix.ansible == 'milestone' }} |
| 87 |
|
| 88 |
steps: |
| 89 |
- name: >- |
| 90 |
Perform unit testing against |
| 91 |
Ansible version ${{ matrix.ansible }} and Python version ${{ matrix.python }} |
| 92 |
|
| 93 |
|
| 94 |
uses: ansible-community/ansible-test-gh-action@d3a8ec7a59694e25e210fcd44738910149537f0e |
| 95 |
with: |
| 96 |
ansible-core-version: ${{ matrix.ansible }} |
| 97 |
target-python-version: ${{ matrix.python }} |
| 98 |
testing-type: units |
| 99 |
|
| 100 |
|
| 101 |
test-deps: >- |
| 102 |
ansible.netcommon |
| 103 |
ansible.utils |
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
pull-request-change-detection: false |