-
Notifications
You must be signed in to change notification settings - Fork 3.9k
70 lines (63 loc) · 1.97 KB
/
testing.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
name: GitHub Actions Linux Testing
on:
push:
branches:
- master
- 'v1.*'
pull_request:
schedule:
- cron: '54 19 * * SUN' # weekly at a "random" time
permissions:
contents: read
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
jre: [8, 11]
fail-fast: false # Should swap to true if we grow a large matrix
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
java-version: ${{ matrix.jre }}
distribution: 'temurin'
- name: Gradle cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Maven cache
uses: actions/cache@v2
with:
path: |
~/.m2/repository
!~/.m2/repository/io/grpc
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml', 'build.gradle') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Protobuf cache
uses: actions/cache@v2
with:
path: /tmp/protobuf-cache
key: ${{ runner.os }}-maven-${{ hashFiles('buildscripts/make_dependencies.sh') }}
- name: Build
run: buildscripts/kokoro/unix.sh
- name: Post Failure Upload Test Reports to Artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: Test Reports (JRE ${{ matrix.jre }})
path: ./*/build/reports/tests/**
retention-days: 14
- name: Check for modified codegen
run: test -z "$(git status --porcelain)" || (git status && echo Error Working directory is not clean. Forget to commit generated files? && false)
- name: Coveralls
if: matrix.jre == 8 # Upload once, instead of for each job in the matrix
run: ./gradlew :grpc-all:coveralls -x compileJava
- name: Codecov
uses: codecov/codecov-action@v2