|
| 1 | +name: ci |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + workflow_call: |
| 6 | + push: |
| 7 | + branches: [ main ] |
| 8 | + pull_request: |
| 9 | + paths: |
| 10 | + - '.github/workflows/ci.yml' |
| 11 | + - '**/*.go' |
| 12 | + - testdata/**/* |
| 13 | + - 'makefile' |
| 14 | + - 'go.mod' |
| 15 | + - 'go.sum' |
| 16 | + - '!**/*.md' |
| 17 | + |
| 18 | +concurrency: |
| 19 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 20 | + cancel-in-progress: true |
| 21 | + |
| 22 | +permissions: |
| 23 | + contents: read |
| 24 | + |
| 25 | +jobs: |
| 26 | + build-and-verify: |
| 27 | + uses: Open-CMSIS-Pack/workflows-and-actions-collection/.github/workflows/[email protected] |
| 28 | + secrets: |
| 29 | + QLTY_COVERAGE_TOKEN: ${{ secrets.QLTY_COVERAGE_TOKEN }} |
| 30 | + with: |
| 31 | + program: cpackget |
| 32 | + test-matrix: '[{"platform":"windows-2022","arch":"amd64"},{"platform":"ubuntu-24.04","arch":"amd64"},{"platform":"macos-14","arch":"amd64"},{"platform":"ubuntu-24.04","arch":"arm64"}]' |
| 33 | + go-version-file: ./go.mod |
| 34 | + enable-code-climate: true |
| 35 | + artifact-retention-days: 7 |
| 36 | + |
| 37 | + # Make sure local_repository.pidx is linted against PackIndex.xsd |
| 38 | + xmllint: |
| 39 | + name: Xmllint |
| 40 | + runs-on: ubuntu-latest |
| 41 | + steps: |
| 42 | + - name: Harden Runner |
| 43 | + uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1 |
| 44 | + with: |
| 45 | + egress-policy: audit |
| 46 | + |
| 47 | + - name: Check out repository code |
| 48 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 49 | + |
| 50 | + - name: Install Go |
| 51 | + uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 |
| 52 | + with: |
| 53 | + go-version-file: go.mod |
| 54 | + check-latest: true |
| 55 | + |
| 56 | + - name: Install xmllint |
| 57 | + run: sudo apt-get update && sudo apt-get install libxml2-utils |
| 58 | + |
| 59 | + - name: Check if local_repository.pidx is valid |
| 60 | + run: | |
| 61 | + make test-xmllint-localrepository |
| 62 | +
|
| 63 | + publish-test-results: |
| 64 | + name: "Publish Tests Results" |
| 65 | + needs: [ build-and-verify ] |
| 66 | + runs-on: ubuntu-latest |
| 67 | + permissions: |
| 68 | + checks: write |
| 69 | + pull-requests: write |
| 70 | + if: ${{ github.event.pull_request.user.login != 'dependabot[bot]' && github.workflow != 'Release' }} |
| 71 | + steps: |
| 72 | + - name: Harden Runner |
| 73 | + uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 |
| 74 | + with: |
| 75 | + egress-policy: audit |
| 76 | + |
| 77 | + - name: Download Artifacts |
| 78 | + uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 |
| 79 | + with: |
| 80 | + path: artifacts |
| 81 | + |
| 82 | + - name: publish test results |
| 83 | + uses: EnricoMi/publish-unit-test-result-action/linux@3a74b2957438d0b6e2e61d67b05318aa25c9e6c6 # v2.20.0 |
| 84 | + with: |
| 85 | + files: artifacts/**/cpackget-testreport-*.xml |
| 86 | + report_individual_runs: true |
0 commit comments