-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (75 loc) · 2.37 KB
/
code-pr-check.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
name: Code PR Check
on:
push:
branches: ["main"]
paths:
- 'src/**'
- 'tests/**'
pull_request:
branches: ["main", "release/**", "fix/**"]
paths:
- 'src/**'
- 'tests/**'
- '.github/workflows/code-pr-check.yml'
- '.github/actions/**'
- 'terraform/**'
- 'adr/**'
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
env:
DOTNET_VERSION: 8
SOLUTION_NAME: 'Dfe.EarlyYearsQualification.sln'
URL: http://127.0.0.1:5000
jobs:
build-app:
name: Build, check and run tests
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Build web app
uses: ./.github/actions/build-dotnet-app
with:
dotnet_version: ${{ env.DOTNET_VERSION }}
solution_filename: ${{ env.SOLUTION_NAME }}
- name: Run unit tests
uses: ./.github/actions/run-unit-tests
with:
solution_filename: ${{ env.SOLUTION_NAME }}
- name: Run app for testing
uses: ./.github/actions/run-app-for-testing
with:
url: ${{ env.URL }}
auth_secret: ${{ secrets.WEBAPP_E2E_ACCESS_KEY }}
- name: Run e2e tests
uses: ./.github/actions/run-e2e-tests
with:
url: ${{ env.URL }}
auth_secret: ${{ secrets.WEBAPP_E2E_ACCESS_KEY }}
- name: Run Accessibility tests
uses: ./.github/actions/run-accessibility-tests
with:
url: ${{ env.URL }}
auth_secret: ${{ secrets.WEBAPP_E2E_ACCESS_KEY }}
security-checks-local:
name: Run baseline security checks locally
runs-on: ubuntu-22.04
needs: build-app
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Run .Net Project
shell: bash
run: |
dotnet run --urls "http://localhost:5000" --project="src/Dfe.EarlyYearsQualification.Web" \
--UseMockContentful=true \
--ServiceAccess:IsPublic="true" &
- name: ZAP Scan
uses: zaproxy/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
docker_name: 'ghcr.io/zaproxy/zaproxy:stable'
target: http://localhost:5000
allow_issue_writing: false
artifact_name: local_scan_dev