-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (48 loc) · 1.31 KB
/
ci.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
name: CI
on:
pull_request:
push:
branches:
- main
env:
isPrFromForkedRepo: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login != 'guardian' }}
jobs:
Scala:
runs-on: ubuntu-latest
# Required by aws-actions/configure-aws-credentials
permissions:
id-token: write
contents: read
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4.5.0
with:
distribution: corretto
java-version: 11
cache: sbt
- name: Setup SBT
uses: sbt/setup-sbt@v1
- name: Test PR from forked repo
if: env.isPrFromForkedRepo == 'true'
run: >
sbt
scalafmtCheckAll
scalafmtSbtCheck
test
assembly
# Required by SBT riffRaffUpload
- name: Assume AWS role
if: env.isPrFromForkedRepo == 'false'
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }}
aws-region: eu-west-1
- name: Upload artefacts to Riffraff
if: env.isPrFromForkedRepo == 'false'
run: >
sbt
scalafmtCheckAll
scalafmtSbtCheck
riffRaffUpload