Skip to content

Run CI tests directly in GitHub Actions #4

Run CI tests directly in GitHub Actions

Run CI tests directly in GitHub Actions #4

Workflow file for this run

name: CI tests
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
sanity:
name: Sanity test ${{ matrix.script }} on JDK ${{ matrix.java_version }}
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
script: ['cftests-junit', 'cftests-nonjunit', 'typecheck-part1', 'typecheck-part2', 'jspecify-conformance']
java_version: [21]
env:
JAVA_VERSION: ${{ matrix.java_version }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java_version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java_version }}
distribution: 'temurin'
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2
- name: Run test script checker/bin-devel/test-${{ matrix.script }}
run: ./checker/bin-devel/test-${{ matrix.script }}.sh
all:
name: Test ${{ matrix.script }} on JDK ${{ matrix.java_version }}
runs-on: ubuntu-latest
needs: sanity
permissions:
contents: read
strategy:
matrix:
script: ['cftests-junit', 'cftests-nonjunit', 'typecheck-part1', 'typecheck-part2']
# JDK 21 used by sanity before
java: [{version: '8', experimental: false},
{version: '11', experimental: false},
{version: '17', experimental: false},
{version: '22', experimental: true},
{version: '23-ea', experimental: true},
{version: '24-ea', experimental: true}]
env:
JAVA_VERSION: ${{ matrix.java.version }}
continue-on-error: ${{ matrix.java.experimental }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java.version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java.version }}
distribution: 'temurin'
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2
- name: Run test script checker/bin-devel/test-${{ matrix.script }}
run: ./checker/bin-devel/test-${{ matrix.script }}.sh
dependency-submission:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2