Merge pull request #28439 from guardian/doml/enable-hls-web #5976
This file contains hidden or 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: '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@v5 | |
| - 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@v5 | |
| - 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@v5 | |
| 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@v5 | |
| - run: corepack enable | |
| - uses: actions/setup-node@v6 | |
| with: | |
| cache: yarn | |
| node-version-file: .nvmrc | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: corretto | |
| cache: sbt | |
| java-version: 11 | |
| # Scala tests rely on client build assets | |
| - name: Download frontend-client | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: frontend-client | |
| path: . | |
| - name: Test, Compile, Package | |
| # Australia/Sydney -because it is too easy for devs to forget about timezones | |
| run: | | |
| java \ | |
| -Xmx6144M \ | |
| -XX:ReservedCodeCacheSize=128m \ | |
| -Dsbt.log.noformat=true \ | |
| -XX:+UseParallelGC \ | |
| -DAPP_SECRET="fake_secret" \ | |
| -Duser.timezone=Australia/Sydney \ | |
| -jar ./bin/sbt-launch.jar compile assets scalafmtCheckAll test Universal/packageBin | |
| - name: Test Summary | |
| uses: test-summary/action@v2 | |
| with: | |
| paths: 'test-results/**/TEST-*.xml' | |
| if: always() | |
| - uses: guardian/[email protected] | |
| 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 |