-
Notifications
You must be signed in to change notification settings - Fork 569
130 lines (110 loc) · 3.67 KB
/
Copy pathbuild.yml
File metadata and controls
130 lines (110 loc) · 3.67 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
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
name: 'Build'
on:
pull_request:
push: # Do not rely on `push` for PR CI - see https://github.com/guardian/mobile-apps-api/pull/2760
branches:
- main # Optimal for GHA workflow caching - see https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache
workflow_dispatch:
permissions:
id-token: write
contents: read
pull-requests: write # Required for riff-raff action
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
client-validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: corepack enable
- uses: actions/setup-node@v6
with:
cache: yarn
node-version-file: .nvmrc
- run: make install
- run: make validate
- run: make test
client-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: corepack enable
- uses: actions/setup-node@v6
with:
cache: yarn
node-version-file: .nvmrc
- run: make install
- run: make compile
- name: upload frontend-client
uses: actions/upload-artifact@v7
with:
name: frontend-client
path: |
static/hash
static/target
common/conf/assets
if-no-files-found: error
build:
needs: [ client-validate, client-build ]
runs-on: 8core-ubuntu-latest-frontend
steps:
- uses: actions/checkout@v6
- run: corepack enable
- uses: actions/setup-node@v6
with:
cache: yarn
node-version-file: .nvmrc
- uses: guardian/setup-scala@v1
# Scala tests rely on client build assets
- name: Download frontend-client
uses: actions/download-artifact@v8
with:
name: frontend-client
path: .
- name: Test, Compile, Package
run: sbt compile assets scalafmtCheckAll test Universal/packageBin
- name: Test Summary
uses: test-summary/action@v2
with:
paths: 'test-results/**/TEST-*.xml'
if: always()
- uses: guardian/actions-riff-raff@v4.3.3
env:
GU_RIFF_RAFF_ROLE_ARN: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }}
if: ${{ env.GU_RIFF_RAFF_ROLE_ARN }}
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
roleArn: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }}
projectName: dotcom:frontend-all
configPath: riff-raff.yaml
contentDirectories: |
frontend-static:
- static/hash
admin:
- admin/target/universal/admin.zip
applications:
- applications/target/universal/applications.zip
archive:
- archive/target/universal/archive.zip
article:
- article/target/universal/article.zip
commercial:
- commercial/target/universal/commercial.zip
discussion:
- discussion/target/universal/discussion.zip
facia:
- facia/target/universal/facia.zip
facia-press:
- facia-press/target/universal/facia-press.zip
identity:
- identity/target/universal/identity.zip
onward:
- onward/target/universal/onward.zip
preview:
- preview/target/universal/preview.zip
rss:
- rss/target/universal/rss.zip
sport:
- sport/target/universal/sport.zip