Skip to content

Commit c49f03d

Browse files
DCMAW-11654: investigating github actions
1 parent 53f1579 commit c49f03d

12 files changed

Lines changed: 471 additions & 507 deletions
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: backend-api post merge
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "backend-api/**"
9+
- ".github/workflows/backend-api-post-merge.yml"
10+
- "!backend-api/**/*.md"
11+
- "!backend-api/**/*.png"
12+
13+
workflow_dispatch:
14+
15+
permissions:
16+
contents: read
17+
id-token: write
18+
19+
jobs:
20+
sonarqube-scan:
21+
name: SonarQube Scan
22+
uses:
23+
govuk-one-login/mobile-id-check-async/.github/workflows/job_sonarqube.yml@DCMAW-11654
24+
with:
25+
WORKING_DIRECTORY: ${{ inputs.WORKING_DIRECTORY }}
26+
secrets: inherit
27+
28+
dev-post-merge:
29+
name: Dev Post Merge
30+
needs: sonarqube-scan
31+
uses:
32+
govuk-one-login/mobile-id-check-async/.github/workflows/workflow_post-merge.yml@DCMAW-11654
33+
with:
34+
WORKING_DIRECTORY: backend-api
35+
secrets:
36+
ARTIFACT_BUCKET_NAME: ${{ secrets.TEST_RESOURCES_DEV_ARTIFACT_BUCKET }}
37+
CONTAINER_SIGN_KMS_KEY: ${{ secrets.DEV_CONTAINER_SIGN_KMS_KEY }}
38+
GH_ACTIONS_ROLE_ARN: ${{ secrets.BACKEND_API_DEV_GH_ACTIONS_ROLE_ARN }}
39+
SIGNING_PROFILE_NAME: ${{ secrets.DEV_SIGNING_PROFILE_NAME }}
40+
TEST_IMAGE_REPOSITORY_URI: ${{ secrets.BACKEND_API_DEV_TEST_IMAGE_REPOSITORY }}
41+
42+
build-post-merge:
43+
name: Build Post Merge
44+
needs: dev-post-merge
45+
uses:
46+
govuk-one-login/mobile-id-check-async/.github/workflows/workflow_post-merge.yml@DCMAW-11654
47+
with:
48+
WORKING_DIRECTORY: backend-api
49+
secrets:
50+
ARTIFACT_BUCKET_NAME: ${{ secrets.TEST_RESOURCES_BUILD_ARTIFACT_BUCKET }}
51+
CONTAINER_SIGN_KMS_KEY: ${{ secrets.BUILD_CONTAINER_SIGN_KMS_KEY }}
52+
GH_ACTIONS_ROLE_ARN: ${{ secrets.BACKEND_API_BUILD_GH_ACTIONS_ROLE_ARN }}
53+
SIGNING_PROFILE_NAME: ${{ secrets.BUILD_SIGNING_PROFILE_NAME }}
54+
TEST_IMAGE_REPOSITORY_URI: ${{ secrets.BACKEND_API_BUILD_TEST_IMAGE_REPOSITORY }}
Lines changed: 21 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: backend-api pull request
22
on:
3-
# Triggers the workflow on pull request events for all branches
43
pull_request:
54
branches:
65
- main
@@ -12,64 +11,28 @@ on:
1211
paths:
1312
- "backend-api/**"
1413
- ".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+
1617
workflow_dispatch:
1718

1819
jobs:
1920
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

.github/workflows/backend-api-push-to-main.yml

Lines changed: 0 additions & 215 deletions
This file was deleted.

0 commit comments

Comments
 (0)