Merge pull request #932 from guardian/update/aws #1150
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/[email protected] | |
with: | |
distribution: corretto | |
java-version: 11 | |
cache: sbt | |
- 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 |