Skip to content

Commit

Permalink
GitHub Action refactoring #5780
Browse files Browse the repository at this point in the history
  • Loading branch information
StepanBrychta committed Sep 16, 2024
1 parent 860e94c commit a5f028b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 39 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,52 +1,22 @@
name: "Release scala-libs"
name: "Report evictions"

on:
pull_request:
types: [opened, edited, synchronize]

env:
SERVICES: '["http"]'

permissions:
id-token: write
issues: write
pull-requests: write
actions: write

jobs:
matrix-config:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.prepare.outputs.matrix }}

steps:
- name: Prepare matrix JSON Object
id: prepare
run: echo 'matrix=${{ env.SERVICES }}' >> $GITHUB_OUTPUT

test:
runs-on: ubuntu-latest
needs: matrix-config
strategy:
matrix:
name: ${{ fromJSON(needs.matrix-config.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: eu-west-1
role-to-assume: ${{ secrets.GHA_SCALA_LIBS_ROLE_ARN }}
- uses: aws-actions/amazon-ecr-login@v2

- name: Run sbt tests
run: ./builds/run_sbt_tests.sh ${{ matrix.name }}

report-evictions:
runs-on: ubuntu-latest
needs: matrix-config
strategy:
matrix:
name: ${{ fromJSON(needs.matrix-config.outputs.matrix) }}
service:
- http
- fixtures
steps:
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
Expand All @@ -55,16 +25,16 @@ jobs:
role-to-assume: ${{ secrets.GHA_SCALA_LIBS_ROLE_ARN }}
- uses: aws-actions/amazon-ecr-login@v2

- name: Run eviction report for ${{ matrix.name }}
run: ./builds/report_sbt_evictions.sh ${{ matrix.name }}
- name: Run eviction report for ${{ matrix.service }}
run: ./builds/report_sbt_evictions.sh ${{ matrix.service }}
continue-on-error: true

- name: Upload eviction reports
if: always() # This ensures it runs even if the previous step fails
uses: actions/upload-artifact@v4
with:
name: evicted_${{ matrix.name }}
path: .reports/evicted_${{ matrix.name }}
name: evicted_${{ matrix.service }}
path: .reports/evicted_${{ matrix.service }}

collate-evictions:
runs-on: ubuntu-latest
Expand All @@ -87,5 +57,5 @@ jobs:
uses: actions/github-script@v6
with:
script: |
const postComment = require('./.github/workflows/post-evictions-comment.js');
const postComment = require('./.github/scripts/post-eviction-report-comment.js');
await postComment(github, context);
27 changes: 27 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Run tests"

on:
pull_request:
types: [opened, edited, synchronize]

permissions:
id-token: write

jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
matrix:
service:
- http
- fixtures
steps:
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: eu-west-1
role-to-assume: ${{ secrets.GHA_SCALA_LIBS_ROLE_ARN }}
- uses: aws-actions/amazon-ecr-login@v2

- name: Run sbt tests
run: ./builds/run_sbt_tests.sh ${{ matrix.service }}

0 comments on commit a5f028b

Please sign in to comment.