|
5 | 5 | branches: |
6 | 6 | - main |
7 | 7 |
|
| 8 | +permissions: {} |
| 9 | + |
8 | 10 | jobs: |
9 | | - sonar-scan: |
| 11 | + unit-tests: |
10 | 12 | runs-on: ubuntu-latest |
| 13 | + concurrency: |
| 14 | + group: unit-tests-${{ github.ref }} |
| 15 | + cancel-in-progress: true |
11 | 16 | permissions: |
12 | 17 | contents: read |
13 | 18 | steps: |
14 | | - - name: Checkout |
15 | | - uses: actions/checkout@v6 |
16 | | - with: |
17 | | - fetch-depth: 0 # required for sonar |
18 | 19 | - name: Setup Node |
19 | | - uses: ./.github/actions/node-setup |
| 20 | + uses: govuk-one-login/github-actions/node/install-dependencies@350c58b28e56f0fd67c4a8d8c8cd4fdc6355bdf3 # my branch - change once merged |
| 21 | + |
20 | 22 | - name: Unit tests |
21 | 23 | run: npm run test:coverage |
22 | | - - name: Sonar scan |
23 | | - uses: SonarSource/sonarqube-scan-action@v7.0.0 |
24 | | - env: |
25 | | - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
| 24 | + |
| 25 | + - name: Upload coverage report |
| 26 | + uses: actions/upload-artifact@v4 |
| 27 | + with: |
| 28 | + name: coverage |
| 29 | + path: coverage/ |
| 30 | + retention-days: 1 |
| 31 | + |
| 32 | + sonar-scan: |
| 33 | + name: Sonar scan |
| 34 | + runs-on: ubuntu-latest |
| 35 | + concurrency: |
| 36 | + group: sonar-${{ github.ref }} |
| 37 | + cancel-in-progress: true |
| 38 | + needs: unit-tests |
| 39 | + permissions: |
| 40 | + contents: read |
| 41 | + steps: |
| 42 | + - name: Run Sonar scan |
| 43 | + uses: govuk-one-login/github-actions/code-quality/sonarcloud@9d6ee027d0b9167dfc25e67124951956278bb585 |
| 44 | + with: |
| 45 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 46 | + sonar-token: ${{ secrets.SONAR_TOKEN }} |
| 47 | + coverage-artifact: coverage |
| 48 | + coverage-run-id: ${{ github.run_id }} |
| 49 | + |
| 50 | + codeql: |
| 51 | + name: CodeQL scan |
| 52 | + runs-on: ubuntu-latest |
| 53 | + concurrency: |
| 54 | + group: codeql-${{ github.ref }} |
| 55 | + cancel-in-progress: true |
| 56 | + permissions: |
| 57 | + security-events: write |
| 58 | + steps: |
| 59 | + - name: Run CodeQL scan |
| 60 | + uses: govuk-one-login/github-actions/code-quality/codeql@f5362528578198e7851e96e0594f593beff0162e |
| 61 | + |
| 62 | + deploy-dev: |
| 63 | + uses: ./.github/workflows/_secure-pipeline-deploy.yml |
| 64 | + concurrency: |
| 65 | + group: deploy-to-dev |
| 66 | + permissions: |
| 67 | + id-token: write |
| 68 | + contents: read |
| 69 | + secrets: |
| 70 | + role_arn: ${{ secrets.DEV_GHA_ROLE_ARN }} |
| 71 | + artifact_bucket: ${{ secrets.DEV_ARTIFACT_BUCKET }} |
| 72 | + container_sign_kms_key: ${{ secrets.DEV_CONTAINER_SIGN_KMS_KEY }} |
| 73 | + ecr_repository_test: ${{ secrets.DEV_ECR_TEST }} |
| 74 | + ecr_repository_traffic_test: ${{ secrets.DEV_ECR_TRAFFIC_TEST }} |
| 75 | + signing_profile: ${{ secrets.DEV_SIGNING_PROFILE_NAME }} |
| 76 | + with: |
| 77 | + environment: development |
| 78 | + |
| 79 | + deploy-build: |
| 80 | + uses: ./.github/workflows/_secure-pipeline-deploy.yml |
| 81 | + concurrency: |
| 82 | + group: deploy-to-build |
| 83 | + permissions: |
| 84 | + id-token: write |
| 85 | + contents: read |
| 86 | + secrets: |
| 87 | + role_arn: ${{ secrets.BUILD_GHA_ROLE_ARN }} |
| 88 | + artifact_bucket: ${{ secrets.BUILD_ARTIFACT_BUCKET }} |
| 89 | + container_sign_kms_key: ${{ secrets.BUILD_CONTAINER_SIGN_KMS_KEY }} |
| 90 | + ecr_repository_test: ${{ secrets.BUILD_ECR_TEST }} |
| 91 | + ecr_repository_traffic_test: ${{ secrets.BUILD_ECR_TRAFFIC_TEST }} |
| 92 | + signing_profile: $ {{ secrets.BUILD_SIGNING_PROFILE_NAME }} |
| 93 | + with: |
| 94 | + environment: build |
0 commit comments