Update GitHub Actions: Replace olafurpg/setup-scala
with actions/setup-java
and sbt/setup-sbt
#17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Test Coverage" | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
branches: | |
- main | |
env: | |
GH_SBT_OPTS: "-Xss64m -Xms1024m -Xmx4G -XX:MaxInlineLevel=18 -XX:+UnlockExperimentalVMOptions" | |
GH_JVM_OPTS: "-Xss64m -Xms1024m -Xmx4G -XX:MaxInlineLevel=18 -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
scala: | |
- { name: "Scala 2.13", version: "2.13.11", binary-version: "2.13", java-version: "17", java-distribution: "liberica", report: "report" } | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.scala.java-version }} | |
distribution: ${{ matrix.scala.java-distribution }} | |
cache: 'sbt' | |
- uses: sbt/setup-sbt@v1 | |
- name: "[Codecov] Report ${{ matrix.scala.name }} ${{ matrix.scala.version }} - ${{ github.run_number }}" | |
if: ${{ matrix.scala.report == 'report' && github.event_name == 'push' }} | |
env: | |
CURRENT_BRANCH_NAME: ${{ github.ref }} | |
RUN_ID: ${{ github.run_id }} | |
RUN_NUMBER: ${{ github.run_number }} | |
JVM_OPTS: ${{ env.GH_JVM_OPTS }} | |
SBT_OPTS: ${{ env.GH_SBT_OPTS }} | |
run: | | |
echo "[BEFORE]CURRENT_BRANCH_NAME=${CURRENT_BRANCH_NAME}" | |
export CURRENT_BRANCH_NAME="${CURRENT_BRANCH_NAME#refs/heads/}" | |
echo " [AFTER]CURRENT_BRANCH_NAME=${CURRENT_BRANCH_NAME}" | |
echo "RUN_ID=${RUN_ID}" | |
echo "RUN_NUMBER=${RUN_NUMBER}" | |
echo "Push #${PUSH_NUMBER}" | |
java -version | |
.github/workflows/sbt-build-all-with-coverage.sh ${{ matrix.scala.version }} | |
- name: "[Codecov] Report ${{ matrix.scala.name }} ${{ matrix.scala.version }} - ${{ github.run_number }} - PR-#${{ github.event.pull_request.number }} - ${{ github.run_number }}" | |
if: ${{ matrix.scala.report == 'report' && github.event_name == 'pull_request' }} | |
env: | |
CURRENT_BRANCH_NAME: ${{ github.base_ref }} | |
RUN_ID: ${{ github.run_id }} | |
RUN_NUMBER: ${{ github.run_number }} | |
PR_NUMBER: ${{ github.event.pull_request.number }} | |
JVM_OPTS: ${{ env.GH_JVM_OPTS }} | |
SBT_OPTS: ${{ env.GH_SBT_OPTS }} | |
run: | | |
echo "Rull request to the '${CURRENT_BRANCH_NAME}' branch" | |
echo "RUN_ID=${RUN_ID}" | |
echo "RUN_NUMBER=${RUN_NUMBER}" | |
echo "PR #${PR_NUMBER}" | |
java -version | |
.github/workflows/sbt-build-all-with-coverage.sh ${{ matrix.scala.version }} | |
- if: ${{ matrix.scala.report == 'report' }} | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |