Skip to content

Commit 0f3b85a

Browse files
authored
Split CI into smaller jobs; add module flags (#32)
1 parent a577875 commit 0f3b85a

4 files changed

Lines changed: 55 additions & 5 deletions

File tree

.ci-build-without-test.sh

100644100755
File mode changed.

.ci-build.sh

100644100755
File mode changed.

.github/workflows/main.yml

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,16 @@ on:
99
jobs:
1010
build:
1111
strategy:
12+
max-parallel: 1
1213
matrix:
13-
jdk: [ 8, 11, 17 ]
14+
jdk: [ 11, 8, 17 ]
1415
runs-on: ubuntu-latest
1516

1617
steps:
18+
- name: Cancel Previous Runs
19+
uses: styfle/cancel-workflow-action@0.10.0
20+
with:
21+
access_token: ${{ github.token }}
1722
- name: Pull Request Checkout
1823
uses: actions/checkout@v2
1924
with:
@@ -28,5 +33,34 @@ jobs:
2833
with:
2934
java-version: ${{matrix.jdk}}
3035
distribution: 'temurin'
31-
- name: Build and test
32-
run: ./.ci-build.sh
36+
- name: Build
37+
id: build
38+
run: ./.ci-build-without-test.sh
39+
40+
- name: PICO Typecheck Test
41+
if: ${{ steps.build.outcome == 'success' }}
42+
run: ./gradlew ImmutabilityTypecheckTest
43+
44+
- name: PICO Typecheck AllSystems Test
45+
if: ${{ steps.build.outcome == 'success' }}
46+
run: ./gradlew ImmutabilityTypecheckBaseAllSystemsTest
47+
48+
- name: PICO Typecheck Extended Test
49+
if: ${{ steps.build.outcome == 'success' }}
50+
run: ./gradlew ImmutabilityTypecheckExtendedTest
51+
52+
- name: PICO Glacier TypeCheck Test
53+
if: ${{ steps.build.outcome == 'success' }}
54+
run: ./gradlew ImmutabilityTypecheckGlacierTest
55+
56+
- name: PICO Inference Initial Typecheck Test
57+
if: ${{ steps.build.outcome == 'success' }}
58+
run: ./gradlew ImmutabilityInferenceInitialTypecheckTest
59+
60+
- name: PICO Inference Test
61+
if: ${{ steps.build.outcome == 'success' }}
62+
run: ./gradlew ImmutabilityInferenceTest
63+
64+
- name: PICO ReIm Inference Test
65+
if: ${{ steps.build.outcome == 'success' }}
66+
run: ./gradlew ImmutabilityReImInferenceTest

build.gradle

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,24 @@ plugins {
99
apply plugin: 'java'
1010

1111
ext {
12-
assert JavaVersion.current() == JavaVersion.VERSION_1_8: "Set JAVA_HOME to JDK 8. Current version is ${JavaVersion.current()}"
12+
isJava8 = JavaVersion.current() == JavaVersion.VERSION_1_8
1313
jsr308 = file(new File("..")).absolutePath
1414
cfPath = "${jsr308}/checker-framework"
1515
cfiPath = "${jsr308}/checker-framework-inference"
1616
afu = "${jsr308}/annotation-tools/annotation-file-utilities"
1717
picoPath = "${jsr308}/immutability"
18+
compilerArgsForRunningCF = [
19+
// Keep in sync with checker-framework/build.gradle.
20+
"--add-exports", "jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
21+
"--add-exports", "jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
22+
"--add-exports", "jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
23+
"--add-exports", "jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED",
24+
"--add-exports", "jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED",
25+
"--add-exports", "jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED",
26+
"--add-exports", "jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",
27+
"--add-exports", "jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED",
28+
"--add-opens", "jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED",
29+
]
1830
}
1931

2032
println '==================================='
@@ -96,7 +108,11 @@ afterEvaluate {
96108

97109
environment "external_checker_classpath", "${picoPath}/build/classes/java/main:${picoPath}/build/resources/main"
98110

99-
jvmArgs "-Xbootclasspath/p:${cfiPath}/dist/javac.jar"
111+
if (isJava8) {
112+
jvmArgs "-Xbootclasspath/p:${cfiPath}/dist/javac.jar"
113+
} else {
114+
jvmArgs += compilerArgsForRunningCF
115+
}
100116

101117
testLogging {
102118
// Always run the tests

0 commit comments

Comments
 (0)