Skip to content

Commit

Permalink
ci: adapt pull request workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcScheib committed Sep 24, 2023
1 parent 976614a commit b0c0631
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 7 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/pull-request_cache-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,28 @@ on:

jobs:
cleanup:
name: Cleanup
uses: CycriLabs/eam-gha-workflows/.github/workflows/be-fe_pull-request_cache-cleanup.yml@main
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
BRANCH=${{ github.ref }}
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 17 additions & 5 deletions .github/workflows/pull-request_test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,20 @@ concurrency:

jobs:
test-and-build:
name: Test and build
uses: CycriLabs/eam-gha-workflows/.github/workflows/be_pull-request_test-build.yml@main
secrets: inherit
with:
java-version: 17
runs-on: ubuntu-latest

steps:
- name: Checkout [${{ github.head_ref || github.ref_name }}]
uses: actions/checkout@v3

- name: Setup GraalVM
uses: graalvm/setup-graalvm@v1
with:
distribution: 'graalvm'
java-version: '17'
components: 'native-image'
cache: 'maven'
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Test project
run: mvn -B package

0 comments on commit b0c0631

Please sign in to comment.