From f32a1ab55286f347bf3c2f7d49a436b161f01d0c Mon Sep 17 00:00:00 2001 From: Jonathan Percival Date: Fri, 16 Feb 2024 10:14:48 -0700 Subject: [PATCH 1/6] Add Windows to PR check --- .github/workflows/check-pr.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-pr.yml b/.github/workflows/check-pr.yml index fd9b65849..77765e072 100644 --- a/.github/workflows/check-pr.yml +++ b/.github/workflows/check-pr.yml @@ -10,7 +10,10 @@ concurrency: jobs: gradle: - runs-on: ubuntu-latest + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - uses: actions/setup-java@v4 @@ -30,5 +33,6 @@ jobs: report_paths: '**/build/test-results/test/TEST-*.xml' - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 + if: matrix.os == 'ubuntu-latest' env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file From 7341ab7a901a21834b774304bad084eae1f5e810 Mon Sep 17 00:00:00 2001 From: Jonathan Percival Date: Fri, 16 Feb 2024 11:32:27 -0700 Subject: [PATCH 2/6] Script updates --- .github/workflows/build.yml | 17 ++++++++--------- .github/workflows/check-pr.yml | 19 ++++++++++--------- .github/workflows/spotless.yml | 12 ++++++------ 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 31a18152f..49f3dfba4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,26 +16,25 @@ jobs: gradle: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '21' - cache: gradle - - name: Setup and execute Gradle 'publish' task - uses: gradle/gradle-build-action@v2 - with: - arguments: check publish - build-root-directory: Src/java + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + - name: Run Gradle Build + working-directory: ./Src/java + run: ./gradlew check publish env: OSSRH_USERNAME: ${{ vars.OSSRH_USERNAME }} OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} - name: Publish Test Report - uses: mikepenz/action-junit-report@v3 + uses: mikepenz/action-junit-report@v4 if: success() || failure() # always run even if the previous step fails with: report_paths: '**/build/test-results/test/TEST-*.xml' - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/check-pr.yml b/.github/workflows/check-pr.yml index 77765e072..0782f08bc 100644 --- a/.github/workflows/check-pr.yml +++ b/.github/workflows/check-pr.yml @@ -15,24 +15,25 @@ jobs: os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '21' cache: gradle - - name: Setup and execute Gradle 'check' task - uses: gradle/gradle-build-action@v2 - with: - arguments: check -x spotlessCheck # there's a separate action for spotless, this way unit tests can be run in parallel - build-root-directory: Src/java + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + - name: Run Gradle Build + working-directory: ./Src/java + run: ./gradlew check -x spotlessCheck - name: Publish Test Report - uses: mikepenz/action-junit-report@v3 - if: success() || failure() # always run even if the previous step fails + uses: mikepenz/action-junit-report@v4 + if: (success() || failure()) && matrix.os == 'ubuntu-latest' with: report_paths: '**/build/test-results/test/TEST-*.xml' + job_name: "Check PR" - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 if: matrix.os == 'ubuntu-latest' env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/spotless.yml b/.github/workflows/spotless.yml index b9e54348f..e8331eb32 100644 --- a/.github/workflows/spotless.yml +++ b/.github/workflows/spotless.yml @@ -10,16 +10,16 @@ jobs: permissions: pull-requests: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '21' - - name: Run gradle spotlessCheck - uses: gradle/gradle-build-action@v2 - with: - arguments: spotlessCheck - build-root-directory: Src/java + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + - name: Run Spotless Check + working-directory: ./Src/java + run: ./gradlew spotlessCheck - uses: mshick/add-pr-comment@v2 if: always() with: From 4d4ed9553d35ff911aa41867cb99d4851fcbbfec Mon Sep 17 00:00:00 2001 From: Jonathan Percival Date: Fri, 16 Feb 2024 11:33:39 -0700 Subject: [PATCH 3/6] run PR check only on code changes to PR --- .github/workflows/check-pr.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-pr.yml b/.github/workflows/check-pr.yml index 0782f08bc..226811f8a 100644 --- a/.github/workflows/check-pr.yml +++ b/.github/workflows/check-pr.yml @@ -1,5 +1,7 @@ name: Check PR -on: pull_request +on: + pull_request: + types: [opened, reopened, synchronize] permissions: checks: write From 06baffcd18762cc2a4a586196868a0d346157e96 Mon Sep 17 00:00:00 2001 From: Jonathan Percival Date: Fri, 16 Feb 2024 11:36:07 -0700 Subject: [PATCH 4/6] Match name of format check --- .github/workflows/spotless.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/spotless.yml b/.github/workflows/spotless.yml index e8331eb32..c08a140fb 100644 --- a/.github/workflows/spotless.yml +++ b/.github/workflows/spotless.yml @@ -1,11 +1,11 @@ -name: gradle spotlessCheck (Formatting) +name: Format Check on: pull_request: types: [opened, reopened, synchronize] jobs: - format-check: + spotless: runs-on: ubuntu-latest permissions: pull-requests: write From efa7fafa3bed746fbec54f59ddfce2d0ba88788a Mon Sep 17 00:00:00 2001 From: Jonathan Percival Date: Fri, 16 Feb 2024 11:37:55 -0700 Subject: [PATCH 5/6] Relax performance testing threshold for windows server --- .../opencds/cqf/cql/engine/execution/CqlPerformanceIT.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Src/java/engine/src/test/java/org/opencds/cqf/cql/engine/execution/CqlPerformanceIT.java b/Src/java/engine/src/test/java/org/opencds/cqf/cql/engine/execution/CqlPerformanceIT.java index 8d470b8f4..f01cce412 100644 --- a/Src/java/engine/src/test/java/org/opencds/cqf/cql/engine/execution/CqlPerformanceIT.java +++ b/Src/java/engine/src/test/java/org/opencds/cqf/cql/engine/execution/CqlPerformanceIT.java @@ -25,7 +25,7 @@ public class CqlPerformanceIT extends CqlTestBase { @Test public void testEngineInit() throws IOException, UcumException { VersionedIdentifier libraryId = toElmIdentifier("Test"); - runPerformanceTest(libraryId, 0.2, null); + runPerformanceTest(libraryId, 1, null); } // This test is for the various CQL operators @@ -34,7 +34,7 @@ public void testMainSuite() throws IOException, UcumException { VersionedIdentifier libraryId = toElmIdentifier("CqlPerformanceTest", "1"); ZonedDateTime date = ZonedDateTime.of(2018, 1, 1, 7, 0, 0, 0, TimeZone.getDefault().toZoneId()); - runPerformanceTest(libraryId, 350.0, date); + runPerformanceTest(libraryId, 1000.0, date); } // This test is for the runtime errors @@ -52,7 +52,7 @@ public void testErrorSuite() throws IOException, UcumException { @Test public void testInternalTypeRepresentationSuite() throws IOException, UcumException { VersionedIdentifier libraryId = toElmIdentifier("CqlInternalTypeRepresentationSuite", "1"); - runPerformanceTest(libraryId, 3.0, null); + runPerformanceTest(libraryId, 10.0, null); } private void runPerformanceTest( From d878ef5ddbf5a4cf7a59c4bcecc8616a9f926dcf Mon Sep 17 00:00:00 2001 From: Jonathan Percival Date: Fri, 16 Feb 2024 11:41:01 -0700 Subject: [PATCH 6/6] Whoops, fat finger --- .../org/opencds/cqf/cql/engine/execution/CqlPerformanceIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/java/engine/src/test/java/org/opencds/cqf/cql/engine/execution/CqlPerformanceIT.java b/Src/java/engine/src/test/java/org/opencds/cqf/cql/engine/execution/CqlPerformanceIT.java index f01cce412..0a6564e2a 100644 --- a/Src/java/engine/src/test/java/org/opencds/cqf/cql/engine/execution/CqlPerformanceIT.java +++ b/Src/java/engine/src/test/java/org/opencds/cqf/cql/engine/execution/CqlPerformanceIT.java @@ -25,7 +25,7 @@ public class CqlPerformanceIT extends CqlTestBase { @Test public void testEngineInit() throws IOException, UcumException { VersionedIdentifier libraryId = toElmIdentifier("Test"); - runPerformanceTest(libraryId, 1, null); + runPerformanceTest(libraryId, 1.0, null); } // This test is for the various CQL operators