-
Notifications
You must be signed in to change notification settings - Fork 272
96 lines (87 loc) · 2.71 KB
/
main.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
88
89
90
91
92
93
94
95
96
# Workflow to run tests
name: CI
on:
push:
branches: [ main, 1.0.24-release, 1.0.25-release ]
pull_request:
branches: [ main, 1.0.24-release, 1.0.25-release ]
workflow_dispatch:
branches: [ main, 1.0.24-release, 1.0.25-release ]
jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
is_pull_request:
- ${{ github.event_name == 'pull_request' }}
exclude:
# Don't run slow targets on pull request.
- is_pull_request: true
os: macos-latest
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
steps:
- name: configure Pagefile
if: matrix.os == 'windows-latest'
uses: al-cheb/[email protected]
with:
minimum-size: 8
maximum-size: 16
disk-root: "D:"
- name: Setup Java 9
uses: actions/[email protected]
with:
java-version: '9'
java-package: jdk
architecture: x64
- name: set JDK_9 environment variable for kotlin compiler
shell: bash
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
run: echo ::set-env name=JDK_9::$(echo $JAVA_HOME)
- name: Setup Java 11
uses: actions/[email protected]
with:
java-version: '11'
java-package: jdk
architecture: x64
# Checkout
- uses: actions/checkout@v2
# Build cache
- name: Cache Gradle Cache
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}-${{ hashFiles('**/gradle.properties') }}
# An ordered list of keys to use for restoring the cache if no cache hit occurred for key
restore-keys: |
${{ runner.os }}-gradle-
- name: Cache gradle wrapper
uses: actions/cache@v2
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
# Run ktlint
- name: lint
if: matrix.os == 'ubuntu-latest'
run: ./gradlew ktlint
# Check API compatibility
- name: API compatibility check
if: matrix.os == 'ubuntu-latest'
run: ./gradlew :api:checkApi
# Run tests
- name: test
shell: bash
run: ./gradlew --stacktrace --info test
- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
with:
name: test-reports-${{ matrix.branch }}-${{ matrix.os }}
path: |
compiler-plugin/build/reports
integration-tests/build/reports
gradle-plugin/build/reports
common-util/build/reports
kotlin-analysis-api/build/reports