Skip to content

Commit cbd5931

Browse files
update build script
1 parent 00dab8e commit cbd5931

File tree

3 files changed

+53
-43
lines changed

3 files changed

+53
-43
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Ci
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
detekt:
13+
uses: ./.github/workflows/gradle-build.yml
14+
with:
15+
gradle-task: clean detekt -x test
16+
17+
test:
18+
uses: ./.github/workflows/gradle-build.yml
19+
with:
20+
gradle-task: clean test -x detekt

.github/workflows/gradle-build.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Gradle Build
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
gradle-task:
7+
required: true
8+
type: string
9+
10+
jobs:
11+
gradle:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Java
19+
uses: actions/setup-java@v4
20+
with:
21+
java-version: '21'
22+
distribution: 'liberica'
23+
24+
- name: Cache files
25+
uses: actions/cache@v3
26+
with:
27+
path: ~/.gradle/caches
28+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
29+
restore-keys: |
30+
${{ runner.os }}-gradle-
31+
32+
- name: Run task
33+
run: ./gradlew ${{ inputs.gradle-task }}

0 commit comments

Comments
 (0)