-
Notifications
You must be signed in to change notification settings - Fork 356
132 lines (132 loc) · 4.91 KB
/
Copy pathcontinuous-integration.yml
File metadata and controls
132 lines (132 loc) · 4.91 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
130
131
132
name: Continuous integration
on:
pull_request:
push:
branches:
- master
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
name: "Build and test on ${{ matrix.os }}"
strategy:
matrix:
include:
- os: macos-latest
- os: windows-latest
- os: ubuntu-latest
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Check out NullAway sources
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
- name: 'Set up JDK 28 EA from jdk.java.net'
uses: oracle-actions/setup-java@ec7274acdd237c7fe61395ed2edda22d756b5afe # v1
with:
website: jdk.java.net
release: 28
- name: 'Set up JDKs'
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0
with:
java-version: |
17
21
25
distribution: 'temurin'
check-latest: 'true'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0
- name: List toolchains
run: ./gradlew javaToolchains
- name: Build and test
run: ./gradlew build
- name: Run shellcheck
run: ./gradlew shellcheck
if: runner.os == 'Linux'
- name: Aggregate jacoco coverage
id: jacoco_report
run: ./gradlew codeCoverageReport
continue-on-error: true
if: runner.os == 'Linux' && github.repository == 'uber/NullAway'
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
files: ./code-coverage-report/build/reports/jacoco/codeCoverageReport/codeCoverageReport.xml
token: ${{ secrets.CODECOV_TOKEN }}
if: steps.jacoco_report.outcome == 'success'
- name: Cleanup Codecov temporary files
run: |
# See https://github.com/codecov/codecov-action/issues/1851
rm -rf codecov codecov.SHA256SUM codecov.SHA256SUM.sig
if: steps.jacoco_report.outcome == 'success'
- name: Test publishToMavenLocal flow
env:
ORG_GRADLE_PROJECT_VERSION_NAME: '0.0.0.1-LOCAL'
ORG_GRADLE_PROJECT_RELEASE_SIGNING_ENABLED: 'false'
run: ./gradlew publishToMavenLocal
- name: Check that Git tree is clean after build and test
run: ./.buildscript/check_git_clean.sh
test-with-error-prone-snapshot:
name: "Test with Error Prone snapshot"
runs-on: ubuntu-latest
steps:
- name: Checkout this repository
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
- name: 'Set up Default JDK'
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0
with:
java-version: 25
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0
- name: Test with Error Prone snapshot
run: ./gradlew testErrorProneLatestSnapshot
compile-other-projects:
name: "Build ${{ matrix.project }} with snapshot"
strategy:
fail-fast: false
matrix:
include:
- project: caffeine
url: https://github.com/ben-manes/caffeine.git
- project: spring-framework
url: https://github.com/spring-projects/spring-framework.git
- project: junit-framework
url: https://github.com/junit-team/junit-framework.git
- project: spring-boot
url: https://github.com/spring-projects/spring-boot.git
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout this repository
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
- name: 'Set up JDKs'
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0
with:
java-version: 25
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0
- name: Publish to Maven Local
env:
ORG_GRADLE_PROJECT_RELEASE_SIGNING_ENABLED: 'false'
run: ./gradlew publishToMavenLocal
- name: Create a temporary directory for ${{ matrix.project }}
run: mkdir -p /tmp/${{ matrix.project }}
- name: Clone ${{ matrix.project }} repository
run: git clone --depth 1 ${{ matrix.url }} /tmp/${{ matrix.project }}
- name: Run ${{ matrix.project }} build
run: |
cp .github/workflows/use-snapshot.gradle.kts /tmp/${{ matrix.project }}
cd /tmp/${{ matrix.project }}
./gradlew --init-script use-snapshot.gradle.kts assemble