forked from google/guice
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (70 loc) · 2.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
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: continuous-integration
env:
USE_BAZEL_VERSION: '4.2.2'
USE_JAVA_DISTRIBUTION: 'zulu'
USE_JAVA_VERSION: '11'
on:
push:
branches:
- master
pull_request:
branches:
- master
concurrency:
# On main branch, we don't want any jobs cancelled so the sha is used to name the group
# On PR branches, we cancel the job if new commits are pushed
# More info: https://stackoverflow.com/a/68422069/253468
group: ${{ (github.ref == 'refs/heads/master') && format('ci-main-{0}', github.sha) || format('ci-main-{0}', github.ref) }}
cancel-in-progress: true
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
java: [8, 11, 15, 17]
fail-fast: false
max-parallel: 4
name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/maven-test
bazel-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
java: [8, 11, 15, 17]
fail-fast: false
max-parallel: 4
name: Bazel Test JDK ${{ matrix.java }}, ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/bazel-test
bazel-build:
runs-on: ubuntu-latest
name: Bazel Build
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/bazel-build
local-artifact-tests:
runs-on: ubuntu-latest
needs: [bazel-build]
name: Local Artifact Tests
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/local-artifact-tests
publish:
runs-on: ubuntu-latest
needs: [test, bazel-test, bazel-build, local-artifact-tests]
if: github.event_name == 'push' && github.repository == 'google/guice' && github.ref == 'refs/heads/master'
name: Publish Javadoc and Snapshot
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/publish-snapshot
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}