|
1 | 1 | name: backend-api pull request |
2 | 2 | on: |
3 | | - # Triggers the workflow on pull request events for all branches |
4 | 3 | pull_request: |
5 | 4 | branches: |
6 | 5 | - main |
|
12 | 11 | paths: |
13 | 12 | - "backend-api/**" |
14 | 13 | - ".github/workflows/backend-api-pull-request.yml" |
15 | | - # Allows you to run this workflow manually from the Actions tab |
| 14 | + - "!backend-api/**/*.md" |
| 15 | + - "!backend-api/**/*.png" |
| 16 | + |
16 | 17 | workflow_dispatch: |
17 | 18 |
|
18 | 19 | jobs: |
19 | 20 | ci-checks: |
20 | | - name: Run CI checks |
21 | | - runs-on: ubuntu-22.04 |
22 | | - defaults: |
23 | | - run: |
24 | | - shell: bash |
25 | | - working-directory: backend-api |
26 | | - steps: |
27 | | - - name: Check out repository code |
28 | | - uses: actions/checkout@v4 |
29 | | - with: |
30 | | - submodules: true |
31 | | - fetch-depth: 0 |
32 | | - |
33 | | - - name: Setup nodeJS v20 |
34 | | - uses: actions/setup-node@v4 |
35 | | - with: |
36 | | - node-version: 20 |
37 | | - cache: npm |
38 | | - cache-dependency-path: backend-api/package-lock.json |
39 | | - |
40 | | - - name: Install dependencies |
41 | | - run: npm install |
42 | | - |
43 | | - - name: Linting |
44 | | - run: npm run lint |
45 | | - |
46 | | - - name: Check formatting using Prettier |
47 | | - run: npm run format:check |
48 | | - |
49 | | - # Runs unit, infra and pact tests |
50 | | - - name: Run tests |
51 | | - run: npm run test |
52 | | - |
53 | | - - name: Generate proxy open api spec |
54 | | - run: npm run generate-proxy-open-api |
55 | | - |
56 | | - - name: Validate SAM template |
57 | | - run: sam validate --lint |
58 | | - |
59 | | - - name: Run SonarCloud Scan |
60 | | - uses: sonarsource/sonarqube-scan-action@0303d6b62e310685c0e34d0b9cde218036885c4d # v5.0.0 |
61 | | - env: |
62 | | - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
63 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
64 | | - with: |
65 | | - projectBaseDir: backend-api |
66 | | - |
67 | | - - name: SonarQube Quality Gate check |
68 | | - uses: Sonarsource/sonarqube-quality-gate-action@8406f4f1edaffef38e9fb9c53eb292fc1d7684fa # master |
69 | | - # Force to fail step after specific time |
70 | | - timeout-minutes: 5 |
71 | | - env: |
72 | | - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
73 | | - with: |
74 | | - scanMetadataReportFile: backend-api/.scannerwork/report-task.txt |
75 | | - |
| 21 | + name: CI Checks |
| 22 | + if: github.event.pull_request.draft == false |
| 23 | + uses: |
| 24 | + govuk-one-login/mobile-id-check-async/.github/workflows/job_ci-checks.yml@DCMAW-11654 |
| 25 | + with: |
| 26 | + GENERATE_PROXY_OPEN_API_SPEC: true |
| 27 | + WORKING_DIRECTORY: backend-api |
| 28 | + secrets: inherit |
| 29 | + |
| 30 | + sonarqube: |
| 31 | + name: SonarQube |
| 32 | + needs: ci-checks |
| 33 | + uses: |
| 34 | + govuk-one-login/mobile-id-check-async/.github/workflows/job_sonarqube.yml@DCMAW-11654 |
| 35 | + with: |
| 36 | + RUN_SONARQUBE_QUALITY_GATE_CHECK: true |
| 37 | + WORKING_DIRECTORY: backend-api |
| 38 | + secrets: inherit |
0 commit comments