From 35571e2a34a27e2d6c59576d47b084e6b99beb6e Mon Sep 17 00:00:00 2001 From: adamw Date: Tue, 3 Sep 2024 13:31:03 +0200 Subject: [PATCH 01/11] Simplify & update CI --- .github/workflows/ci.yml | 61 ++++++++++++---------------------------- README.md | 2 +- 2 files changed, 19 insertions(+), 44 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 78b6a6c..c262a54 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,57 +13,39 @@ jobs: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository || github.event.pull_request.user.login == 'softwaremill-ci' - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout - uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v4 with: - java-version: 11 - - name: Cache sbt - uses: actions/cache@v2 - with: - path: | - ~/.sbt - ~/.ivy2/cache - ~/.coursier - key: sbt-cache-${{ runner.os }}-${{ hashFiles('project/build.properties') }} + distribution: 'zulu' + java-version: '21' + cache: 'sbt' - name: Compile run: sbt -v compile - name: Compile documentation run: sbt -v compileDocs - name: Test run: sbt -v test - - name: Cleanup - run: | - rm -rf "$HOME/.ivy2/local" || true - find $HOME/.ivy2/cache -name "ivydata-*.properties" -delete || true - find $HOME/.ivy2/cache -name "*-LM-SNAPSHOT*" -delete || true - find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true - find $HOME/.sbt -name "*.lock" -delete || true + publish: name: Publish release needs: [ci] if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v')) - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 env: JAVA_OPTS: -Xmx4G steps: - name: Checkout - uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v4 with: - java-version: 11 - - name: Cache sbt - uses: actions/cache@v2 - with: - path: | - ~/.sbt - ~/.ivy2/cache - ~/.coursier - key: sbt-cache-${{ runner.os }}-${{ hashFiles('project/build.properties') }} + distribution: 'zulu' + java-version: '21' + cache: 'sbt' - name: Compile run: sbt compile - name: Publish artifacts @@ -89,13 +71,6 @@ jobs: version: "v${{ env.VERSION }}" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Cleanup - run: | - rm -rf "$HOME/.ivy2/local" || true - find $HOME/.ivy2/cache -name "ivydata-*.properties" -delete || true - find $HOME/.ivy2/cache -name "*-LM-SNAPSHOT*" -delete || true - find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true - find $HOME/.sbt -name "*.lock" -delete || true # `automerge` label is attached iff there is exactly one file changed by steward and this file belongs to a # whitelist specified by `labeler.yml` @@ -103,7 +78,7 @@ jobs: name: Attach automerge label # only for PRs by softwaremill-ci if: github.event.pull_request.user.login == 'softwaremill-ci' - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 with: @@ -126,11 +101,11 @@ jobs: # only for PRs by softwaremill-ci if: github.event.pull_request.user.login == 'softwaremill-ci' needs: [ ci, label ] - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - id: automerge name: automerge uses: "pascalgn/automerge-action@v0.15.6" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - MERGE_METHOD: "squash" \ No newline at end of file + MERGE_METHOD: "squash" diff --git a/README.md b/README.md index 6f0b5a4..4e00901 100644 --- a/README.md +++ b/README.md @@ -373,4 +373,4 @@ We offer commercial support for sttp and related technologies, as well as develo ## Copyright -Copyright (C) 2023 SoftwareMill [https://softwaremill.com](https://softwaremill.com). \ No newline at end of file +Copyright (C) 2023 SoftwareMill [https://softwaremill.com](https://softwaremill.com). From 0834e97bc0c35505066c96bc46d7f755ef11217d Mon Sep 17 00:00:00 2001 From: adamw Date: Tue, 3 Sep 2024 13:32:03 +0200 Subject: [PATCH 02/11] Simplify & update CI --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c262a54..946e9ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository || github.event.pull_request.user.login == 'softwaremill-ci' - runs-on: ubuntu-24.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -34,7 +34,7 @@ jobs: name: Publish release needs: [ci] if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v')) - runs-on: ubuntu-24.04 + runs-on: ubuntu-22.04 env: JAVA_OPTS: -Xmx4G steps: @@ -78,7 +78,7 @@ jobs: name: Attach automerge label # only for PRs by softwaremill-ci if: github.event.pull_request.user.login == 'softwaremill-ci' - runs-on: ubuntu-24.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 with: @@ -101,7 +101,7 @@ jobs: # only for PRs by softwaremill-ci if: github.event.pull_request.user.login == 'softwaremill-ci' needs: [ ci, label ] - runs-on: ubuntu-24.04 + runs-on: ubuntu-22.04 steps: - id: automerge name: automerge From feb61577084bf946f1b4ad07cb1d0dd8d87278f2 Mon Sep 17 00:00:00 2001 From: adamw Date: Tue, 3 Sep 2024 13:36:27 +0200 Subject: [PATCH 03/11] Experiment --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 946e9ea..9ef0b9c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,9 +10,9 @@ jobs: # run on 1) push, 2) external PRs, 3) softwaremill-ci PRs # do not run on internal, non-steward PRs since those will be run by push to branch if: | - github.event_name == 'push' || - github.event.pull_request.head.repo.full_name != github.repository || - github.event.pull_request.user.login == 'softwaremill-ci' + github.event_name != 'pull_request' && + (github.event.pull_request.head.repo.full_name != github.repository || + github.event.pull_request.user.login == 'softwaremill-ci') runs-on: ubuntu-22.04 steps: - name: Checkout From d45096223cab03be151f75b0909dd834a60eed1a Mon Sep 17 00:00:00 2001 From: adamw Date: Tue, 3 Sep 2024 13:37:38 +0200 Subject: [PATCH 04/11] Experiment --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ef0b9c..00333f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,9 +10,9 @@ jobs: # run on 1) push, 2) external PRs, 3) softwaremill-ci PRs # do not run on internal, non-steward PRs since those will be run by push to branch if: | - github.event_name != 'pull_request' && - (github.event.pull_request.head.repo.full_name != github.repository || - github.event.pull_request.user.login == 'softwaremill-ci') + github.event_name != 'pull_requestĻ' || + github.event.pull_request.head.repo.full_name != github.repository || + github.event.pull_request.user.login == 'softwaremill-ci' runs-on: ubuntu-22.04 steps: - name: Checkout From f58ec57ffbbada313962f2dbfe853472b210566f Mon Sep 17 00:00:00 2001 From: adamw Date: Tue, 3 Sep 2024 13:39:24 +0200 Subject: [PATCH 05/11] Experiment --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00333f8..869b785 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: # run on 1) push, 2) external PRs, 3) softwaremill-ci PRs # do not run on internal, non-steward PRs since those will be run by push to branch if: | - github.event_name != 'pull_requestĻ' || + github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository || github.event.pull_request.user.login == 'softwaremill-ci' runs-on: ubuntu-22.04 From ac09a9b9b902a9c5d554d6fba1c07fe91ad8a553 Mon Sep 17 00:00:00 2001 From: adamw Date: Tue, 3 Sep 2024 13:44:44 +0200 Subject: [PATCH 06/11] Add test reports --- .github/workflows/ci.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 869b785..aa7c19c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: # run on 1) push, 2) external PRs, 3) softwaremill-ci PRs # do not run on internal, non-steward PRs since those will be run by push to branch if: | - github.event_name != 'pull_request' || + github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository || github.event.pull_request.user.login == 'softwaremill-ci' runs-on: ubuntu-22.04 @@ -29,6 +29,11 @@ jobs: run: sbt -v compileDocs - name: Test run: sbt -v test + - uses: actions/upload-artifact@v3 # upload test results + if: success() || failure() # run this step even if previous step failed + with: + name: 'tests-results' + path: '**/test-reports/TEST*.xml' publish: name: Publish release @@ -109,3 +114,16 @@ jobs: env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" MERGE_METHOD: "squash" + + test-report: + runs-on: ubuntu-22.04 + # If the workflow run was skipped or cancelled this action would fail, generating a test report is unnecessary. + if: ${{ github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure' }} + needs: [ ci ] + steps: + - uses: dorny/test-reporter@v1 + with: + artifact: '/tests-results-(.*)/' + name: 'Test report for $1' + path: '**/test-reports/TEST*.xml' + reporter: java-junit From 0713cc170cf484ac5b0003b69f8ac26a454d7f80 Mon Sep 17 00:00:00 2001 From: adamw Date: Tue, 3 Sep 2024 13:45:28 +0200 Subject: [PATCH 07/11] Style --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa7c19c..d92fbfb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -116,10 +116,10 @@ jobs: MERGE_METHOD: "squash" test-report: - runs-on: ubuntu-22.04 # If the workflow run was skipped or cancelled this action would fail, generating a test report is unnecessary. if: ${{ github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure' }} needs: [ ci ] + runs-on: ubuntu-22.04 steps: - uses: dorny/test-reporter@v1 with: From ca8eef53e0ef9ab0dd31df2c41151cd3323db862 Mon Sep 17 00:00:00 2001 From: adamw Date: Tue, 3 Sep 2024 13:48:25 +0200 Subject: [PATCH 08/11] Fix labeler config --- .github/labeler.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/labeler.yml b/.github/labeler.yml index 7f5cee6..dce9fd6 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -6,9 +6,11 @@ labels: - "build.sbt" - "project/plugins.sbt" - "project/build.properties" + - "project/Dependencies.scala" - label: "dependency" authors: ["softwaremill-ci"] files: - "build.sbt" - "project/plugins.sbt" - "project/build.properties" + - "project/Dependencies.scala" From 106e56cfea7f2e9fdf2f436d3a6bba9a97497d51 Mon Sep 17 00:00:00 2001 From: adamw Date: Tue, 3 Sep 2024 13:52:31 +0200 Subject: [PATCH 09/11] Use new upload-artifact --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d92fbfb..2eeb577 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: run: sbt -v compileDocs - name: Test run: sbt -v test - - uses: actions/upload-artifact@v3 # upload test results + - uses: actions/upload-artifact@v4 # upload test results if: success() || failure() # run this step even if previous step failed with: name: 'tests-results' From 859e52fa237fe9e3ba68db4e04afbfc34b8f8283 Mon Sep 17 00:00:00 2001 From: adamw Date: Tue, 3 Sep 2024 13:53:46 +0200 Subject: [PATCH 10/11] Run test-report separately --- .github/workflows/ci.yml | 13 ------------- .github/workflows/test-report.yml | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/test-report.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2eeb577..5476d56 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,16 +114,3 @@ jobs: env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" MERGE_METHOD: "squash" - - test-report: - # If the workflow run was skipped or cancelled this action would fail, generating a test report is unnecessary. - if: ${{ github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure' }} - needs: [ ci ] - runs-on: ubuntu-22.04 - steps: - - uses: dorny/test-reporter@v1 - with: - artifact: '/tests-results-(.*)/' - name: 'Test report for $1' - path: '**/test-reports/TEST*.xml' - reporter: java-junit diff --git a/.github/workflows/test-report.yml b/.github/workflows/test-report.yml new file mode 100644 index 0000000..32aec5e --- /dev/null +++ b/.github/workflows/test-report.yml @@ -0,0 +1,24 @@ +name: 'Test Report' +on: + workflow_run: + workflows: ['CI'] + types: + - completed + +permissions: + contents: read + actions: read + checks: write + +jobs: + report: + runs-on: ubuntu-22.04 + # If the workflow run was skipped or cancelled this action would fail, generating a test report is unnecessary. + if: ${{ github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure' }} + steps: + - uses: dorny/test-reporter@v1 + with: + artifact: '/tests-results-(.*)/' + name: 'Test report for $1' + path: '**/test-reports/TEST*.xml' + reporter: java-junit From 876723cdd410419c1f7f47005f5eafc427dc95ba Mon Sep 17 00:00:00 2001 From: adamw Date: Tue, 3 Sep 2024 14:03:38 +0200 Subject: [PATCH 11/11] Simplify steward config --- .github/workflows/scala-steward.yml | 10 +++++----- .scala-steward.conf | 8 +++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/scala-steward.yml b/.github/workflows/scala-steward.yml index 7b59b45..cc913fd 100644 --- a/.github/workflows/scala-steward.yml +++ b/.github/workflows/scala-steward.yml @@ -11,12 +11,12 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 + uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v4 with: - distribution: 'temurin' - java-version: 11 + distribution: 'zulu' + java-version: '21' cache: 'sbt' - name: Launch Scala Steward uses: scala-steward-org/scala-steward-action@v2 diff --git a/.scala-steward.conf b/.scala-steward.conf index ac1a8c1..b0b57bf 100644 --- a/.scala-steward.conf +++ b/.scala-steward.conf @@ -1,8 +1,6 @@ -updates.ignore = [ - {groupId = "org.scala-lang", artifactId = "scala-compiler", version = "2.13."}, - {groupId = "org.scala-lang", artifactId = "scala-compiler", version = "3."} -] updates.pin = [ + {groupId = "com.typesafe.akka", version = "2.6."}, {groupId = "org.scala-lang", artifactId = "scala3-library", version = "3.3."}, - {groupId = "org.scala-lang", artifactId = "scala3-library_sjs1", version = "3.3."} + {groupId = "org.scala-lang", artifactId = "scala3-library_sjs1", version = "3.3."}, + {groupId = "org.scala-lang", artifactId = "scala-library", version = "2.13."} ]