-
Notifications
You must be signed in to change notification settings - Fork 3
104 lines (89 loc) · 2.62 KB
/
test.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Test application
run-name: Test application [${{ github.head_ref || github.ref_name }}]
on:
merge_group:
types:
- checks_requested
pull_request:
branches:
- main
types:
- opened
- reopened
- ready_for_review
- synchronize
permissions:
id-token: write
contents: read
defaults:
run:
shell: bash
jobs:
run-checkov:
name: Checkov
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Run checkov
uses: govuk-one-login/github-actions/code-quality/run-checkov@9c5db98832a3d5f8d27e08eb0b3d89d186c8e163
with:
skip-checks:
CKV_SECRET_6
CKV_SECRET_9
check-shell-scripts:
name: Shell scripts
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Run shell checks
uses: govuk-one-login/github-actions/code-quality/check-shell-scripts@5dacba941def444d69f02843feaebed79b5fca51 # 11/04/2023
check-linting:
name: Linting
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check linting and formatting
uses: govuk-one-login/github-actions/code-quality/check-linting@5dacba941def444d69f02843feaebed79b5fca51 # 11/04/2023
check-vulnerabilities:
name: Vulnerabilities
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Run security audit
uses: govuk-one-login/github-actions/code-quality/run-security-audit@5dacba941def444d69f02843feaebed79b5fca51 # 11/04/2023
with:
workspaces: true
sonarcloud:
if: startsWith(github.head_ref, 'dependabot') != true
name: SonarCloud
runs-on: ubuntu-latest
steps:
- name: Pull repository
id: checkout
uses: actions/checkout@v4
- name: Install Node dependencies
run: npm install
- name: Generate coverage report
run: npm run test:cov
- name: Fix Code Coverage Paths
working-directory: ./coverage
run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' lcov.info
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run-unit-tests:
name: Run unit tests
runs-on: ubuntu-latest
steps:
- name: Pull repository
id: checkout
uses: actions/checkout@v4
- name: Install Node dependencies
run: npm install
- name: Run unit tests
id: run-tests
env:
REPORT: ${{ runner.temp }}/unit-tests.report
run: npm run test -- --config infrastructure/ci/jest.config.ts