-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (64 loc) · 1.98 KB
/
backend-api-pull-request.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: backend-api pull request
on:
# Triggers the workflow on pull request events for all branches
pull_request:
branches:
- main
types:
- opened
- reopened
- ready_for_review
- synchronize
paths:
- "backend-api/**"
- ".github/workflows/backend-api-pull-request.yml"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
ci-checks:
name: Run CI checks
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
working-directory: backend-api
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Setup nodeJS v20
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: backend-api/package-lock.json
- name: Install dependencies
run: npm install
- name: Linting
run: npm run lint
- name: Check formatting using Prettier
run: npm run format:check
# Runs unit, infra and pact tests
- name: Run tests
run: npm run test
- name: Generate proxy open api spec
run: npm run generate-proxy-open-api
- name: Validate SAM template
run: sam validate --lint
- name: Run SonarCloud Scan
uses: sonarsource/sonarqube-scan-action@bfd4e558cda28cda6b5defafb9232d191be8c203 # v4.2.1
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
projectBaseDir: backend-api
- name: SonarQube Quality Gate check
uses: Sonarsource/sonarqube-quality-gate-action@8406f4f1edaffef38e9fb9c53eb292fc1d7684fa # master
# Force to fail step after specific time
timeout-minutes: 5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
scanMetadataReportFile: backend-api/.scannerwork/report-task.txt