diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6adf5ea..8279d2b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,48 +17,39 @@ on: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +concurrency: + group: ${{ github.workflow }} @ ${{ github.ref }} + cancel-in-progress: true + jobs: build: name: Build and Test strategy: matrix: os: [ubuntu-latest] - scala: [3.2.0] + scala: [3] java: [temurin@11] runs-on: ${{ matrix.os }} + timeout-minutes: 60 steps: - name: Checkout current branch (full) - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Download Java (temurin@11) - id: download-java-temurin-11 + - name: Setup Java (temurin@11) + id: setup-java-temurin-11 if: matrix.java == 'temurin@11' - uses: typelevel/download-java@v2 + uses: actions/setup-java@v4 with: distribution: temurin java-version: 11 + cache: sbt - - name: Setup Java (temurin@11) - if: matrix.java == 'temurin@11' - uses: actions/setup-java@v3 - with: - distribution: jdkfile - java-version: 11 - jdkFile: ${{ steps.download-java-temurin-11.outputs.jdkFile }} - - - name: Cache sbt - uses: actions/cache@v3 - with: - path: | - ~/.sbt - ~/.ivy2/cache - ~/.coursier/cache/v1 - ~/.cache/coursier/v1 - ~/AppData/Local/Coursier/Cache/v1 - ~/Library/Caches/Coursier/v1 - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + - name: sbt update + if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false' + run: sbt +update - name: Check that workflows are up to date run: sbt githubWorkflowCheck @@ -71,15 +62,15 @@ jobs: - name: Make target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v')) - run: mkdir -p modules/examples/.native/target modules/core/.native/target modules/docs/target target modules/core/.jvm/target modules/examples/.jvm/target project/target + run: mkdir -p modules/core/.native/target modules/core/.jvm/target project/target - name: Compress target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v')) - run: tar cf targets.tar modules/examples/.native/target modules/core/.native/target modules/docs/target target modules/core/.jvm/target modules/examples/.jvm/target project/target + run: tar cf targets.tar modules/core/.native/target modules/core/.jvm/target project/target - name: Upload target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v')) - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }} path: targets.tar @@ -95,44 +86,29 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Download Java (temurin@11) - id: download-java-temurin-11 + - name: Setup Java (temurin@11) + id: setup-java-temurin-11 if: matrix.java == 'temurin@11' - uses: typelevel/download-java@v2 + uses: actions/setup-java@v4 with: distribution: temurin java-version: 11 + cache: sbt - - name: Setup Java (temurin@11) - if: matrix.java == 'temurin@11' - uses: actions/setup-java@v3 - with: - distribution: jdkfile - java-version: 11 - jdkFile: ${{ steps.download-java-temurin-11.outputs.jdkFile }} + - name: sbt update + if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false' + run: sbt +update - - name: Cache sbt - uses: actions/cache@v3 - with: - path: | - ~/.sbt - ~/.ivy2/cache - ~/.coursier/cache/v1 - ~/.cache/coursier/v1 - ~/AppData/Local/Coursier/Cache/v1 - ~/Library/Caches/Coursier/v1 - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - - - name: Download target directories (3.2.0) - uses: actions/download-artifact@v3 + - name: Download target directories (3) + uses: actions/download-artifact@v4 with: - name: target-${{ matrix.os }}-${{ matrix.java }}-3.2.0 + name: target-${{ matrix.os }}-${{ matrix.java }}-3 - - name: Inflate target directories (3.2.0) + - name: Inflate target directories (3) run: | tar xf targets.tar rm targets.tar diff --git a/project/plugins.sbt b/project/plugins.sbt index e688419..8971639 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -2,6 +2,6 @@ addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2. addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.3.7") addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.4.2") -addSbtPlugin("org.typelevel" % "sbt-typelevel-github-actions" % "0.4.21") +addSbtPlugin("org.typelevel" % "sbt-typelevel-github-actions" % "0.6.5") addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.2.0") addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.17")