|
| 1 | +--- |
| 2 | +name: platform collection tests |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + |
| 7 | +jobs: |
| 8 | + sanity: |
| 9 | + name: platform collection sanity |
| 10 | + runs-on: ubuntu-latest |
| 11 | + env: |
| 12 | + HEADLESS: "yes" |
| 13 | + timeout-minutes: 30 |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + ansible: |
| 18 | + - stable-2.16 |
| 19 | + - stable-2.17 |
| 20 | + - stable-2.18 |
| 21 | + - stable-2.19 |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v3 |
| 24 | + |
| 25 | + - name: Perform sanity testing |
| 26 | + uses: ansible-community/ansible-test-gh-action@release/v1 |
| 27 | + with: |
| 28 | + ansible-core-version: ${{ matrix.ansible }} |
| 29 | + collection-root: . |
| 30 | + testing-type: sanity |
| 31 | + target-python-version: 3.11 |
| 32 | + |
| 33 | + # TO-DO |
| 34 | + # - name: Upload gateway jUnit test reports to the unified dashboard |
| 35 | + # if: >- |
| 36 | + # !cancelled() |
| 37 | + # && steps.make-run.outputs.test-result-files != '' |
| 38 | + # && github.event_name == 'push' |
| 39 | + # && env.UPSTREAM_REPOSITORY_ID == github.repository_id |
| 40 | + # && github.ref_name == github.event.repository.default_branch |
| 41 | + # run: | |
| 42 | + # for junit_file in $(echo '${{ steps.make-run.outputs.test-result-files }}' | sed 's/,/ /') |
| 43 | + # do |
| 44 | + # curl \ |
| 45 | + # -v \ |
| 46 | + # --user "${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_USER }}:${{ secrets.PDE_ORG_RESULTS_UPLOAD_PASSWORD }}" \ |
| 47 | + # --form "xunit_xml=@${junit_file}" \ |
| 48 | + # --form "component_name=gateway" \ |
| 49 | + # --form "git_commit_sha=${{ github.sha }}" \ |
| 50 | + # --form "git_repository_url=https://github.com/${{ github.repository }}" \ |
| 51 | + # "${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_URL }}/api/results/upload/" |
| 52 | + # done |
| 53 | + |
| 54 | + docs: |
| 55 | + name: Check module doc strings |
| 56 | + runs-on: ubuntu-latest |
| 57 | + env: |
| 58 | + HEADLESS: "yes" |
| 59 | + steps: |
| 60 | + - name: Install python 3.11 |
| 61 | + uses: actions/setup-python@v4 |
| 62 | + with: |
| 63 | + python-version: 3.11 |
| 64 | + |
| 65 | + - name: Install requirements |
| 66 | + run: pip3.11 install --upgrade ansible |
| 67 | + |
| 68 | + - uses: actions/checkout@v3 |
| 69 | + |
| 70 | + - name: Run ansible-doc |
| 71 | + run: make collection-docs |
| 72 | + |
| 73 | + - name: Get ansible-doc version |
| 74 | + run: ansible-doc --version |
| 75 | + if: failure() |
| 76 | + |
| 77 | + lint: |
| 78 | + name: Lint module |
| 79 | + runs-on: ubuntu-latest |
| 80 | + env: |
| 81 | + HEADLESS: "yes" |
| 82 | + steps: |
| 83 | + - name: Install python 3.11 |
| 84 | + uses: actions/setup-python@v4 |
| 85 | + with: |
| 86 | + python-version: 3.11 |
| 87 | + |
| 88 | + - name: Install requirements |
| 89 | + run: pip3.11 install --upgrade ansible-lint |
| 90 | + |
| 91 | + - uses: actions/checkout@v3 |
| 92 | + |
| 93 | + - name: Run ansible-lint |
| 94 | + run: make collection-lint |
| 95 | + |
| 96 | + - name: Get ansible-lint version |
| 97 | + run: ansible-lint --version |
| 98 | + if: failure() |
| 99 | +... |
0 commit comments