Skip to content

Commit b969a78

Browse files
authored
Merge pull request #14 from jetbrains-academy/arseniy/improve-github-workflows
Improve GitHub workflows
2 parents cbc47b8 + dcbffd8 commit b969a78

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

.github/workflows/gradle-build-with-detekt.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,26 @@ name: Gradle Build With Detekt
22

33
on: [push, pull_request]
44

5+
# Allow cancelling all previous runs for the same branch
6+
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
511
jobs:
612
build:
713
runs-on: ubuntu-20.04
814

915
steps:
10-
- uses: actions/checkout@v3.0.0
16+
- uses: actions/checkout@v4
1117
- name: Set up JDK 17
12-
uses: actions/setup-java@v3.0.0
18+
uses: actions/setup-java@v3
1319
with:
1420
java-version: 17
1521
distribution: liberica
1622
- name: Gradle Wrapper Validation
1723
uses: gradle/[email protected]
18-
- uses: gradle/gradle-build-action@v2.1.5
24+
- uses: gradle/gradle-build-action@v2
1925
with:
2026
arguments: build --stacktrace -PrunDetekt
2127

.github/workflows/gradle-build.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,26 @@ name: Gradle Build
22

33
on: [push, pull_request]
44

5+
# Allow cancelling all previous runs for the same branch
6+
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
511
jobs:
612
build:
713
runs-on: ubuntu-20.04
814

915
steps:
10-
- uses: actions/checkout@v3.0.0
16+
- uses: actions/checkout@v4
1117
- name: Set up JDK 17
12-
uses: actions/setup-java@v3.0.0
18+
uses: actions/setup-java@v3
1319
with:
1420
java-version: 17
1521
distribution: liberica
1622
- name: Gradle Wrapper Validation
1723
uses: gradle/[email protected]
18-
- uses: gradle/gradle-build-action@v2.1.5
24+
- uses: gradle/gradle-build-action@v2
1925
with:
2026
arguments: build --stacktrace
2127

0 commit comments

Comments
 (0)