-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
98 lines (95 loc) · 3.24 KB
/
ci.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
97
98
name: CI
on:
pull_request: {}
push: { branches: [ master ] }
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
jobs:
find_gradle_jobs:
runs-on: ubuntu-18.04
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '1.8'
- name: Cache Gradle Home files
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-home-testmatrix-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-home-testmatrix-
${{ runner.os }}-gradle-home-
- id: set-matrix
env:
# Since we override the tests executor,
# we should not push empty results to the cache
READ_ONLY_REMOTE_GRADLE_CACHE: true
run: |
TASKS=$(./gradlew --no-daemon --parallel -q testMatrix)
echo $TASKS
echo "::set-output name=matrix::{\"gradle_args\":$TASKS}"
check:
needs: find_gradle_jobs
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.find_gradle_jobs.outputs.matrix) }}
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '1.8'
- name: Cache Gradle Home files
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-home-${{matrix.gradle_args}}_check-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-home-${{matrix.gradle_args}}_check-
${{ runner.os }}-gradle-home-${{matrix.gradle_args}}_check-
${{ runner.os }}-gradle-home-
- name: Clear existing docker image cache
run: docker image prune -af
- name: Build and test with Gradle (${{matrix.gradle_args}})
run: |
./gradlew --no-daemon --continue --scan --info ${{matrix.gradle_args}}
- name: Aggregate test reports with ciMate
if: always()
env:
CIMATE_PROJECT_ID: 2348n4vl
CIMATE_CI_KEY: "CI / ${{ runner.os }} / ${{matrix.gradle_args}}"
run: |
wget -q https://get.cimate.io/release/linux/cimate
chmod +x cimate
./cimate "**/TEST-*.xml"
examples:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '1.8'
- name: Cache Gradle Home files
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-home-examples-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-home-examples-
- name: Build and test Examples with Gradle
working-directory: ./examples/
run: |
./gradlew --no-daemon --scan --info check
- name: Aggregate test reports with ciMate
if: always()
env:
CIMATE_PROJECT_ID: 2348n4vl
CIMATE_CI_KEY: examples
run: |
wget -q https://get.cimate.io/release/linux/cimate
chmod +x cimate
./cimate "**/TEST-*.xml"