-
Notifications
You must be signed in to change notification settings - Fork 33
68 lines (58 loc) · 2.15 KB
/
ci.yml
File metadata and controls
68 lines (58 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
check-skip:
runs-on: ubuntu-latest
outputs:
should-skip: ${{ steps.check-labels.outputs.should-skip }}
steps:
- id: check-labels
if: github.event_name == 'pull_request'
uses: actions/github-script@v6
with:
script: |
const labels = await github.rest.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number
});
const docLabel = labels.data.find(label => label.name === 'type: doc');
if (docLabel) {
console.log('PR has type: doc label, skipping CI');
return core.setOutput('should-skip', 'true');
}
console.log('PR does not have type: doc label, continuing with CI');
return core.setOutput('should-skip', 'false');
build-test:
needs: check-skip
if: ${{ github.event_name != 'pull_request' || needs.check-skip.outputs.should-skip != 'true' }}
name: "Unit Test On ${{ matrix.os }} - jdk${{ matrix.java-version }}"
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
java-version: [11,15,17]
steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java-version }}
distribution: 'zulu'
- name: test
run: ./gradlew test --stacktrace
- name: package plugin
run: ./plugin-script/package_plugin.sh
- name: Cleanup Gradle Cache
if: runner.os == 'Linux' || runner.os == 'macOS'
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties