-
Notifications
You must be signed in to change notification settings - Fork 7
87 lines (70 loc) · 2.26 KB
/
verify.yml
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: verify
on: [ pull_request ]
jobs:
release-ready:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'stable'
steps:
- uses: actions/checkout@v2
- name: Get current version
id: current_version
run: |
version="$(gradle -q version)"
echo "$version"
echo "::set-output name=current_version::$version"
shell: bash
- name: Check version format
run: |
# verify the version has "MAJOR.MINOR.PATCH" parts only
echo "${{ steps.current_version.outputs.current_version }}" | grep -e '^[0-9]\+\.[0-9]\+\.[0-9]\+$'
shell: bash
# TODO improve (DRY): copy-paste from release.yml
- name: Get release info
id: release_info
run: |
release_info="$(curl -s https://api.github.com/repos/${{ github.repository }}/releases \
| jq '.[] | select(.name == "v${{ steps.current_version.outputs.current_version }}")')"
echo "::set-output name=release_info::$release_info"
echo "$release_info"
shell: bash
- name: Check version bumped
# TODO check if greater than latest tag / release (?)
if: steps.release_info.outputs.release_info
run: exit 1
# XXX do we need that here
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 8
- name: check it can be packaged
run: |
gradle jar
ls lib/build/libs
shell: bash
unit:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
java: ['8', '11', '13', '15', '17' ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
- name: Execute tests
run: gradle test
static-ktlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 8
- name: check code
run: gradle ktlintCheck