Skip to content

Commit b5bf870

Browse files
committed
update workflow
1 parent 6d03510 commit b5bf870

File tree

2 files changed

+41
-100
lines changed

2 files changed

+41
-100
lines changed

.github/workflows/build.yml

Lines changed: 41 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,53 @@
1-
name: build
2-
3-
on: [ push ]
1+
name: Gradle CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
paths-ignore: [ "**.md", "schemas/**", ".editorconfig", ".gitignore", ".gitattributes" ]
7+
pull_request:
8+
branches: [ master ]
9+
paths-ignore: [ "**.md", "schemas/**", ".editorconfig", ".gitignore", ".gitattributes" ]
10+
create:
11+
tags:
412

513
jobs:
6-
7-
linux:
8-
name: 'Linux'
9-
runs-on: ubuntu-latest
10-
14+
gradle:
15+
runs-on: "ubuntu-latest"
16+
timeout-minutes: 30
1117
steps:
1218
- uses: actions/checkout@v3
13-
- uses: gradle/wrapper-validation-action@v1
14-
- name: Set up JDK 1.8
15-
uses: actions/setup-java@v3
16-
with:
17-
distribution: temurin
18-
java-version: 8
19-
- name: Grant execute permission for gradlew
20-
run: chmod +x gradlew
21-
# - name: Build with Gradle
22-
# run: ./gradlew build -x dokkaHtml -x dokkaHtmlJar
23-
- uses: burrunan/gradle-cache-action@v1
24-
name: Build
19+
20+
- uses: actions/setup-java@v3
2521
with:
26-
arguments: assemble #-x dokkaHtml -x dokkaHtmlJar -x javadoc -x dokkaJavadocJar
27-
# - name: Cleanup Gradle Cache
28-
# # Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
29-
# # Restoring these files from a GitHub Actions cache might cause problems for future builds.
30-
# run: |
31-
# rm -f ~/.gradle/caches/modules-2/modules-2.lock
32-
# rm -f ~/.gradle/caches/modules-2/gc.properties
33-
# - name: Show Working directory content
34-
# run: ls
35-
# - uses: actions/checkout@master
36-
# with:
37-
# repository: kotlin-graphics/mary
38-
# path: ./mary
39-
- name: Show ../.. directory content
40-
run: ls ../..
41-
# - name: move mary up
42-
# run: mv ./mary ../..
43-
# - name: Show Working directory content
44-
# run: ls
45-
# - name: Show ../.. directory content
46-
# run: ls ../..
22+
distribution: zulu
23+
java-version: 1.8
4724

48-
windows:
49-
name: 'Windows'
50-
runs-on: windows-latest
25+
- name: Setup Gradle
26+
uses: gradle/gradle-build-action@v2
5127

52-
steps:
53-
- uses: actions/checkout@v3
54-
- uses: gradle/wrapper-validation-action@v1
55-
- name: Set up JDK 1.8
56-
uses: actions/setup-java@v3
28+
- name: Setup Gradle Dependencies Cache
29+
uses: actions/cache@v3
5730
with:
58-
distribution: temurin
59-
java-version: 8
60-
# - name: Build with Gradle
61-
# run: .\gradlew.bat build -x dokkaHtml -x dokkaHtmlJar
62-
- uses: burrunan/gradle-cache-action@v1
63-
name: Build
64-
with:
65-
arguments: assemble #-x dokkaHtml -x dokkaHtmlJar -x javadoc -x dokkaJavadocJar
66-
# - name: Cleanup Gradle Cache
67-
# # Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
68-
# # Restoring these files from a GitHub Actions cache might cause problems for future builds.
69-
# run: |
70-
# rm -f ~/.gradle/caches/modules-2/modules-2.lock
71-
# rm -f ~/.gradle/caches/modules-2/gc.properties
31+
path: ~/.gradle/caches
32+
key: gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }}
7233

73-
mac:
74-
name: 'Mac OS'
75-
runs-on: macos-latest
7634

77-
steps:
78-
- uses: actions/checkout@v3
79-
- uses: gradle/wrapper-validation-action@v1
80-
- name: Set up JDK 1.8
81-
uses: actions/setup-java@v3
35+
- name: Setup Gradle Wrapper Cache
36+
uses: actions/cache@v3
37+
with:
38+
path: ~/.gradle/wrapper
39+
key: gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
40+
41+
- name: Build
42+
uses: gradle/gradle-build-action@v2
43+
with:
44+
arguments: assemble
45+
- name: Test
46+
uses: gradle/gradle-build-action@v2
8247
with:
83-
distribution: temurin
84-
java-version: 8
85-
- name: Grant execute permission for gradlew
86-
run: chmod +x gradlew
87-
# - name: Build with Gradle
88-
# run: ./gradlew build -x dokkaHtml -x dokkaHtmlJar
89-
- uses: burrunan/gradle-cache-action@v1
90-
name: Build
48+
arguments: check
49+
- name: Publish
50+
if: startsWith(github.ref, 'refs/tags/v')
51+
uses: gradle/gradle-build-action@v2
9152
with:
92-
arguments: assemble #-x dokkaHtml -x dokkaHtmlJar -x javadoc -x dokkaJavadocJar
93-
# - name: Cleanup Gradle Cache
94-
# # Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
95-
# # Restoring these files from a GitHub Actions cache might cause problems for future builds.
96-
# run: |
97-
# rm -f ~/.gradle/caches/modules-2/modules-2.lock
98-
# rm -f ~/.gradle/caches/modules-2/gc.properties
53+
arguments: check

.github/workflows/test.yml

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

0 commit comments

Comments
 (0)