-
Notifications
You must be signed in to change notification settings - Fork 1.2k
114 lines (108 loc) · 3.82 KB
/
Copy pathci.yml
File metadata and controls
114 lines (108 loc) · 3.82 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
# Cancel in-progress runs for pull requests, but not for master branch pushes
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test:
name: "JDK ${{ matrix.java }}"
strategy:
matrix:
java: [ 8, 11, 17 ]
runs-on: ubuntu-latest
steps:
- name: 'Check out repository'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
- name: 'Cache local Maven repository'
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9
with:
path: ~/.m2/repository
key: maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
maven-
- name: 'Set up JDK ${{ matrix.java }}'
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
- name: 'Install'
shell: bash
run: mvn -B dependency:go-offline test clean -U --quiet --fail-never -DskipTests=true -f build-pom.xml
- name: 'Test'
shell: bash
# One of the auto-service-ksp test deps was built targeting JDK 11, so we skip its tests
# here and only run them on JDK 11+ in the next step.
run: mvn -B verify -U --fail-at-end -Dsource.skip=true -Dmaven.javadoc.skip=true -pl '!service/processor_ksp' -f build-pom.xml
- name: 'Test auto-service-ksp'
if: ${{ matrix.java >= 11 }}
shell: bash
run: mvn -B verify -U --fail-at-end -Dsource.skip=true -Dmaven.javadoc.skip=true -f service/pom.xml
publish_snapshot:
name: 'Publish snapshot'
needs: test
if: github.event_name == 'push' && github.repository == 'google/auto'
runs-on: ubuntu-latest
steps:
- name: 'Check out repository'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
- name: 'Cache local Maven repository'
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9
with:
path: ~/.m2/repository
key: maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
maven-
- name: 'Set up JDK 11'
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95
with:
java-version: 11
distribution: 'temurin'
server-id: central
server-username: CI_DEPLOY_USERNAME
server-password: CI_DEPLOY_PASSWORD
- name: 'Publish'
env:
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
run: ./util/publish-snapshot-on-commit.sh
generate_docs:
permissions:
contents: write
name: 'Generate latest docs'
needs: test
if: github.event_name == 'push' && github.repository == 'google/auto'
runs-on: ubuntu-latest
steps:
- name: 'Check out repository'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
- name: 'Cache local Maven repository'
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9
with:
path: ~/.m2/repository
key: maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
maven-
- name: 'Set up JDK 17' # need 15+ to avoid https://bugs.openjdk.org/browse/JDK-8241780
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95
with:
java-version: 17
distribution: 'temurin'
- name: 'Generate latest docs'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./util/generate-latest-docs.sh