Skip to content

Commit 9489a8a

Browse files
authored
Merge pull request #101 from aSemy/feat/gha_build_cache
Build GHA: enable caching, concurrent-cancellation, and version updates
2 parents bd7dbf5 + b3953b4 commit 9489a8a

File tree

1 file changed

+26
-14
lines changed

1 file changed

+26
-14
lines changed

.github/workflows/build.yml

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,34 @@
11
name: Build
2-
on: [push]
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
10+
cancel-in-progress: true
311

412
jobs:
513
build:
614

715
runs-on: ubuntu-latest
816

917
steps:
10-
- uses: actions/checkout@v2
11-
- uses: actions/setup-java@v2
12-
with:
13-
java-version: 11
14-
distribution: adopt
15-
cache: gradle
16-
- name: Build with Gradle
17-
run: |
18-
./gradlew assemble
19-
- name: Test with Gradle
20-
run: |
21-
unset GITHUB_ACTIONS
22-
./gradlew test
18+
- uses: actions/checkout@v2
19+
20+
- uses: actions/setup-java@v3
21+
with:
22+
java-version: 11
23+
distribution: adopt
24+
25+
- uses: gradle/gradle-build-action@v2
26+
27+
- name: Build with Gradle
28+
run: |
29+
./gradlew assemble
30+
31+
- name: Test with Gradle
32+
run: |
33+
unset GITHUB_ACTIONS
34+
./gradlew test

0 commit comments

Comments
 (0)