forked from jspecify/jspecify-reference-checker
-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (100 loc) · 4.09 KB
/
Copy pathbuild.yml
File metadata and controls
104 lines (100 loc) · 4.09 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
name: Continuous Integration
on: [push, pull_request]
env:
# Set to 'true' if a release of the EISOP CF should be used.
# Otherwise, it will be cloned and built.
EISOP_RELEASE: true
jobs:
build-and-test:
name: Build and Test on JDK ${{ matrix.java_version }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: jspecify-reference-checker
strategy:
matrix:
java_version: [17, 21, 25]
steps:
- name: Check out jspecify-reference checker
uses: actions/checkout@v6
with:
path: jspecify-reference-checker
- name: Check out jspecify
uses: actions/checkout@v6
with:
repository: jspecify/jspecify
path: jspecify
# Explicitly check out jspecify/jdk before initialize-project runs.
# At least in eisop/jspecify-reference-checker we want to use
# jspecify/jdk, not eisop/jdk.
# I am not sure what the best setup is - at this point initialize-project
# does not do anything useful.
- name: Check out jspecify/jdk
uses: actions/checkout@v6
with:
repository: jspecify/jdk
path: jdk
# Clone the EISOP CF if necessary:
- name: Check out eisop/checker-framework
uses: actions/checkout@v6
if: ${{ env.EISOP_RELEASE != 'true' }}
with:
repository: eisop/checker-framework
path: checker-framework
# Optionally, if a particular branch should be used.
# ref: typetools-3.43.0-fixes
- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: ${{ matrix.java_version }}
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6
- name: Build and Test (EISOP release)
if: ${{ env.EISOP_RELEASE == 'true' }}
# If a released CF is needed, use the following:
run: ./gradlew build conformanceTests demoTest --include-build ../jspecify --warning-mode all
env:
SHALLOW: 1
JSPECIFY_CONFORMANCE_TEST_MODE: details
- name: Build and Test (EISOP build)
if: ${{ env.EISOP_RELEASE != 'true' }}
# If a cloned EISOP CF is needed, use the following:
run: ./gradlew build conformanceTests demoTest --include-build ../jspecify --include-build ../checker-framework --warning-mode all --no-configuration-cache
env:
SHALLOW: 1
JSPECIFY_CONFORMANCE_TEST_MODE: details
- name: Check out jspecify/samples-google-prototype-eisop
if: always()
run: |
git fetch --depth=1 origin samples-google-prototype-eisop
git checkout samples-google-prototype-eisop
working-directory: jspecify
- name: Run Samples Tests (EISOP release)
if: ${{ always() && env.EISOP_RELEASE == 'true' }}
# If a released CF is needed, use the following:
run: ./gradlew jspecifySamplesTest --include-build ../jspecify --warning-mode all
- name: Run Samples Tests (EISOP build)
if: ${{ always() && env.EISOP_RELEASE != 'true' }}
# If a cloned EISOP CF is needed, use the following:
run: ./gradlew jspecifySamplesTest --include-build ../jspecify --include-build ../checker-framework --warning-mode all --no-configuration-cache
publish-snapshot:
name: Publish Conformance Test Framework Snapshot
runs-on: ubuntu-latest
needs: build-and-test
if: github.repository == 'jspecify/jspecify-reference-checker' && github.ref_name == 'main' && github.event_name == 'push'
steps:
- name: Check out the code
uses: actions/checkout@v6
- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6
- name: Publish snapshot
run: ./gradlew publishConformanceTestFrameworkPublicationToSonatypeRepository --warning-mode all --no-configuration-cache
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.sonatype_username }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.sonatype_password }}