-
Notifications
You must be signed in to change notification settings - Fork 4
73 lines (61 loc) · 1.83 KB
/
pr-checks.yml
File metadata and controls
73 lines (61 loc) · 1.83 KB
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
name: Run PR checks
run-name: "Running checks for PR #${{ github.event.pull_request.number }} (${{ github.event.pull_request.title }})"
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
build:
name: Build and test
runs-on: codebuild-nhsd-nrlf-ci-build-project-${{ github.run_id }}-${{ github.run_attempt }}
environment: pull-request
permissions:
contents: read
actions: write
steps:
- name: Git clone - ${{ github.ref }}
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Setup environment
run: |
echo "${HOME}/.asdf/bin" >> $GITHUB_PATH
poetry install --no-root
- name: Lint
run: make lint
- name: Build
run: make build
- name: Test
run: make test
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: dist
sonar:
name: SonarQube scan
runs-on: ubuntu-latest
needs: build
environment: pull-request
permissions:
contents: read
actions: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Get build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: dist
- name: SonarQube scan
uses: sonarsource/sonarqube-scan-action@a31c9398be7ace6bbfaf30c0bd5d415f843d45e9 #v7.0.0
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: SonarQube quality gate check
id: sonarqube-quality-gate-check
uses: sonarsource/sonarqube-quality-gate-action@cf038b0e0cdecfa9e56c198bbb7d21d751d62c3b #v1.2.0
with:
pollingTimeoutSec: 600
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}