-
Notifications
You must be signed in to change notification settings - Fork 273
129 lines (122 loc) · 3.97 KB
/
Copy pathci.yml
File metadata and controls
129 lines (122 loc) · 3.97 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
# 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:
build:
name: 'Build'
runs-on: ubuntu-latest
steps:
- name: 'Check out repository'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
- name: 'Set up JDK 26 for compilation'
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95
with:
java-version: 26
distribution: 'temurin'
cache: 'maven'
- name: 'Install'
shell: bash
run: mvn -B -P!standard-with-extra-repos install -U -DskipTests=true
- name: 'Javadoc Test Run'
shell: bash
run: mvn -B -P!standard-with-extra-repos javadoc:aggregate -U
- name: 'Upload build artifacts'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: truth-jars
path: |
**/target/*.jar
!**/target/*-sources.jar
!**/target/*-javadoc.jar
test:
name: "Test with JDK ${{ matrix.java }}"
needs: build
strategy:
matrix:
java: [ 8, 17, 25 ]
runs-on: ubuntu-latest
steps:
- name: 'Check out repository'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
- name: 'Set up JDK ${{ matrix.java }} for testing'
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'maven'
- name: 'Download build artifacts'
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
with:
name: truth-jars
- name: 'Unpack artifacts'
shell: bash
run: |
for f in $(find . -name "*.jar" ! -name "*-gwt.jar"); do
dest="${f%/target/*}/target/classes"
mkdir -p "$dest"
unzip -o "$f" -d "$dest"
done
- name: 'Test'
shell: bash
run: mvn -B -P!standard-with-extra-repos verify -U -Dmaven.javadoc.skip=true -Dmaven.main.skip=true
publish_snapshot:
name: 'Publish snapshot'
needs: [build, test]
if: github.event_name == 'push' && github.repository == 'google/truth'
runs-on: ubuntu-latest
steps:
- name: 'Check out repository'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
- name: 'Set up JDK 26'
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95
with:
java-version: 26
distribution: 'temurin'
cache: 'maven'
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: mvn -B clean deploy -DskipTests=true
generate_docs:
permissions:
contents: write
name: 'Generate latest docs'
needs: [build, test]
if: github.event_name == 'push' && github.repository == 'google/truth'
runs-on: ubuntu-latest
steps:
- name: 'Check out repository'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
- name: 'Set up JDK 26'
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95
with:
java-version: 26
distribution: 'temurin'
cache: 'maven'
- name: 'Generate latest docs'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./util/generate-latest-docs.sh