Skip to content

Commit 05ba003

Browse files
committed
Create ci.yml
1 parent c74b3fe commit 05ba003

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 17-github-actions-for-running-spotless-and-tests
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v3
19+
20+
- name: Set up JDK 17
21+
uses: actions/setup-java@v3
22+
with:
23+
java-version: '17'
24+
distribution: 'corretto'
25+
26+
- name: Cache Kotlin dependencies
27+
uses: actions/cache@v3
28+
with:
29+
path: ~/.gradle/caches
30+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
31+
restore-keys: |
32+
${{ runner.os }}-gradle-
33+
34+
- name: Cache Gradle wrapper
35+
uses: actions/cache@v3
36+
with:
37+
path: ~/.gradle/wrapper
38+
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
39+
restore-keys: |
40+
${{ runner.os }}-gradle-wrapper-
41+
42+
- name: Run spotless and tests
43+
run: ./gradlew spotlessApply test
44+
45+
- name: Run tests
46+
run: ./gradlew test

0 commit comments

Comments
 (0)