From a92b8e5c01f1aa33bea5bb1ceefcf93a1c115fb0 Mon Sep 17 00:00:00 2001 From: Adam Semenenko <152864218+adam-enko@users.noreply.github.com> Date: Mon, 5 Aug 2024 11:39:23 +0200 Subject: [PATCH] Test macOS on pull requests and master Use the same GitHub Action to test PRs and master branch. This will avoid failing tests sneaking into master. --- .../{tests-thorough.yml => gradle-tests.yml} | 11 ++++-- .github/workflows/tests-smoke.yml | 36 ------------------- 2 files changed, 9 insertions(+), 38 deletions(-) rename .github/workflows/{tests-thorough.yml => gradle-tests.yml} (71%) delete mode 100644 .github/workflows/tests-smoke.yml diff --git a/.github/workflows/tests-thorough.yml b/.github/workflows/gradle-tests.yml similarity index 71% rename from .github/workflows/tests-thorough.yml rename to .github/workflows/gradle-tests.yml index 6ade9f1b45..10b8721a75 100644 --- a/.github/workflows/tests-thorough.yml +++ b/.github/workflows/gradle-tests.yml @@ -1,18 +1,25 @@ -name: Test [thorough] +name: Gradle Tests on: + pull_request: workflow_dispatch: push: branches: - master +concurrency: + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' + # Cancel if there is a new update only on pull requests + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: test-matrix: strategy: matrix: os: [ ubuntu-latest, windows-latest, macos-latest ] javaVersion: [ 8, 11, 17, 21 ] - fail-fast: false + # Enable fail-fast on pull requests, to avoid clogging up CI + fail-fast: ${{ github.event_name == 'pull_request' }} runs-on: ${{ matrix.os }} steps: - name: Set longpaths support for Windows diff --git a/.github/workflows/tests-smoke.yml b/.github/workflows/tests-smoke.yml deleted file mode 100644 index 667f92526d..0000000000 --- a/.github/workflows/tests-smoke.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Test [smoke] - -on: pull_request - -concurrency: - group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' - cancel-in-progress: true - -env: - JAVA_TEST_VERSION: 11 - -jobs: - test-matrix: - strategy: - matrix: - os: [ ubuntu-latest, windows-latest ] - fail-fast: false - runs-on: ${{ matrix.os }} - steps: - - name: Set longpaths support for Windows - if: matrix.os == 'windows-latest' - # Avoid failing tests on Windows with "cannot create directory at X. Filename too long" - # This command will fail if run on a Linux build agent with "could not lock config file: Permission denied" - run: git config --system core.longpaths true - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - distribution: 'zulu' - java-version: 17 - - uses: gradle/actions/setup-gradle@v3 - with: - gradle-home-cache-cleanup: true - - name: Run tests - run: > - ./gradlew test --stacktrace --continue - "-Porg.jetbrains.dokka.javaToolchain.testLauncher=${{ env.JAVA_TEST_VERSION }}"