-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (76 loc) · 2.52 KB
/
checks-and-tests.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
---
name: Checks and Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
java-checks-and-tests:
name: Java Checks and Tests
runs-on: ubuntu-latest
# Add "id-token" with the required permissions.
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Checkout
uses: actions/checkout@v3
# Google auth allows maven to pull artifacts from our registry
# And acquire a token for authenticating with the docker registry
- id: auth
name: Authenticate to Google Cloud
uses: google-github-actions/auth@v1
with:
token_format: 'access_token'
workload_identity_provider: ${{ secrets.WIF_PROVIDER }}
service_account: ${{ secrets.SERVICE_ACCOUNT }}
# Authenticating with Dockerhub ensures image pulls are authenticated, so not as severely rate limited
- name: Log in to Dockerhub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Also log docker in to GCP, to allow image pulls from our private registries
- name: Log in to Google Docker Artifact Registry
uses: docker/login-action@v3
with:
registry: europe-west2-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}
- name: Set Up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
cache: maven
- name: Set Up Docker Network
run: docker network create ssdcrmdockerdev_default
- name: Maven Checks
run: make check-mvn
- name: Run Tests
run: mvn verify jacoco:report
node-checks:
name: Node Checks
runs-on: ubuntu-latest
defaults:
run:
working-directory: ui
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set Up Node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Update NPM
# The setup node action links the version of NPM to the version of node
# However, locally we use an up-to-date NPM so CI needs to match this
# See https://github.com/actions/setup-node/issues/529
run: npm install -g [email protected]
- name: Install Dependencies
run: make install
- name: Run Format Check
run: make format-check
- name: Run Package Audit
run: make package-audit