-
Notifications
You must be signed in to change notification settings - Fork 0
178 lines (153 loc) · 5.08 KB
/
gnm-style.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: Build and upload
on:
push:
branches: ["**"]
workflow_dispatch: {}
jobs:
concierge-graphql-gnm:
runs-on: ubuntu-latest
# The first two permissions are needed to interact with GitHub's OIDC Token endpoint.
# The second set of three permissions are needed to write test results back to GH
permissions:
id-token: write
contents: read
issues: read
checks: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: corretto
java-version: 11
cache: sbt
- name: Build and test
env:
SBT_JUNIT_OUTPUT: ./junit-tests
JAVA_OPTS: -Dsbt.log.noformat=true
run: |
sbt 'test;debian:packageBin'
- name: Store the built artifacts
uses: actions/upload-artifact@v4
with:
name: backend-deb
path: target/concierge-graphql_0.1.0_all.deb
retention-days: 5
compression-level: 0 #artifact is already compressed
cdk-build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'yarn'
cache-dependency-path: cdk/yarn.lock
- run: yarn install --frozen-lockfile
name: Prepare for CDK infrastructure build
working-directory: cdk
- run: yarn test
name: Test CDK infrastructure integrity
working-directory: cdk
- run: yarn synth
name: Build infrastructure definition from CDK
working-directory: cdk
- name: Store the built artifacts
uses: actions/upload-artifact@v4
with:
name: cdk.out
path: cdk/cdk.out
retention-days: 5
compression-level: 5
graphiql-explorer:
runs-on: ubuntu-latest
# The first two permissions are needed to interact with GitHub's OIDC Token endpoint.
# The second set of three permissions are needed to write test results back to GH
permissions:
id-token: write
contents: read
issues: read
checks: write
packages: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18.x
cache: 'yarn'
cache-dependency-path: explorer/yarn.lock
- run: yarn install --frozen-lockfile
name: Prepare to build explorer
working-directory: explorer
- run: yarn build
name: Build explorer
working-directory: explorer
- name: Store the built artifacts
uses: actions/upload-artifact@v4
with:
name: explorer
path: explorer/build
retention-days: 5
compression-level: 5
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push container
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm64
context: explorer
tags: ghcr.io/guardian/concierge-graphql/graphiql-explorer:${{ github.run_number }}
riffraff-upload:
runs-on: ubuntu-latest
needs:
- concierge-graphql-gnm
- graphiql-explorer
- cdk-build
# The first two permissions are needed to interact with GitHub's OIDC Token endpoint.
# The second set of three permissions are needed to write test results back to GH
permissions:
id-token: write
contents: read
issues: read
checks: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: artifacts
- run: ls -lh artifacts/*
- uses: guardian/actions-riff-raff@v4
with:
roleArn: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }}
githubToken: ${{ secrets.GITHUB_TOKEN }}
configPath: ./riff-raff.yaml
projectName: Content Platforms::concierge-graphql-experimental
contentDirectories: |
concierge-graphql:
- artifacts/backend-deb/concierge-graphql_0.1.0_all.deb
graphiql-explorer:
- artifacts/explorer
cloudformation:
- artifacts/cdk.out/ConciergeGraphql-PROD-AARDVARK.template.json
- artifacts/cdk.out/ConciergeGraphql-CODE-AARDVARK.template.json
cloudformation-preview:
- artifacts/cdk.out/ConciergeGraphql-preview-PROD-AARDVARK.template.json
- artifacts/cdk.out/ConciergeGraphql-preview-CODE-AARDVARK.template.json
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
if: always() #runs even if there is a test failure
with:
files: junit-tests/*.xml