diff --git a/.ci-build-without-test.sh b/.ci-build-without-test.sh old mode 100644 new mode 100755 diff --git a/.ci-build.sh b/.ci-build.sh old mode 100644 new mode 100755 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3a67d6b..2750514 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,11 +9,16 @@ on: jobs: build: strategy: + max-parallel: 1 matrix: - jdk: [ 8, 11, 17 ] + jdk: [ 11, 8, 17 ] runs-on: ubuntu-latest steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.10.0 + with: + access_token: ${{ github.token }} - name: Pull Request Checkout uses: actions/checkout@v2 with: @@ -28,5 +33,34 @@ jobs: with: java-version: ${{matrix.jdk}} distribution: 'temurin' - - name: Build and test - run: ./.ci-build.sh + - name: Build + id: build + run: ./.ci-build-without-test.sh + + - name: PICO Typecheck Test + if: ${{ steps.build.outcome == 'success' }} + run: ./gradlew ImmutabilityTypecheckTest + + - name: PICO Typecheck AllSystems Test + if: ${{ steps.build.outcome == 'success' }} + run: ./gradlew ImmutabilityTypecheckBaseAllSystemsTest + + - name: PICO Typecheck Extended Test + if: ${{ steps.build.outcome == 'success' }} + run: ./gradlew ImmutabilityTypecheckExtendedTest + + - name: PICO Glacier TypeCheck Test + if: ${{ steps.build.outcome == 'success' }} + run: ./gradlew ImmutabilityTypecheckGlacierTest + + - name: PICO Inference Initial Typecheck Test + if: ${{ steps.build.outcome == 'success' }} + run: ./gradlew ImmutabilityInferenceInitialTypecheckTest + + - name: PICO Inference Test + if: ${{ steps.build.outcome == 'success' }} + run: ./gradlew ImmutabilityInferenceTest + + - name: PICO ReIm Inference Test + if: ${{ steps.build.outcome == 'success' }} + run: ./gradlew ImmutabilityReImInferenceTest diff --git a/build.gradle b/build.gradle index 6ed9539..9ba9976 100644 --- a/build.gradle +++ b/build.gradle @@ -9,12 +9,24 @@ plugins { apply plugin: 'java' ext { - assert JavaVersion.current() == JavaVersion.VERSION_1_8: "Set JAVA_HOME to JDK 8. Current version is ${JavaVersion.current()}" + isJava8 = JavaVersion.current() == JavaVersion.VERSION_1_8 jsr308 = file(new File("..")).absolutePath cfPath = "${jsr308}/checker-framework" cfiPath = "${jsr308}/checker-framework-inference" afu = "${jsr308}/annotation-tools/annotation-file-utilities" picoPath = "${jsr308}/immutability" + compilerArgsForRunningCF = [ + // Keep in sync with checker-framework/build.gradle. + "--add-exports", "jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED", + "--add-exports", "jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED", + "--add-exports", "jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED", + "--add-exports", "jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED", + "--add-exports", "jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED", + "--add-exports", "jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED", + "--add-exports", "jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED", + "--add-exports", "jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED", + "--add-opens", "jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED", + ] } println '===================================' @@ -96,7 +108,11 @@ afterEvaluate { environment "external_checker_classpath", "${picoPath}/build/classes/java/main:${picoPath}/build/resources/main" - jvmArgs "-Xbootclasspath/p:${cfiPath}/dist/javac.jar" + if (isJava8) { + jvmArgs "-Xbootclasspath/p:${cfiPath}/dist/javac.jar" + } else { + jvmArgs += compilerArgsForRunningCF + } testLogging { // Always run the tests