Bump actions/cache from 3 to 4 #14
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: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: {} | |
jobs: | |
core: | |
name: Reflect scala_versions | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
java: [ '1.14' ] | |
scala: [ | |
{ version: '2.12.18', bincompat: '2.12' } | |
] | |
outputs: | |
scala_versions: ${{ steps.set-scala-versions.outputs.scala_versions }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: olafurpg/setup-scala@v14 | |
with: | |
java-version: zulu@${{ matrix.java }} | |
- name: Set scala version for matrix | |
id: set-scala-versions # The greps on the following line are to ensure as much as possible that we've caught the right line | |
run: echo "scala_versions=$(sbt 'print githubMatrixSettings' | grep '^\[{' | grep 'bincompat' | tail -n 1)" >> $GITHUB_OUTPUT | |
scala: | |
runs-on: ubuntu-20.04 | |
needs: [core] | |
strategy: | |
matrix: | |
java: [ '1.14', '1.17' ] | |
scala: ${{ fromJson(needs.core.outputs.scala_versions) }} | |
framework: [ | |
{ framework: 'pekko-http', project: 'sample-pekkoHttp' }, | |
] | |
steps: | |
- run: echo 'combo_enabled=true' >> $GITHUB_ENV | |
- run: echo 'combo_enabled=false' >> $GITHUB_ENV | |
if: ${{ matrix.java == '1.17' && matrix.scala.bincompat == '2.12' }} | |
- run: echo 'combo_enabled=false' >> $GITHUB_ENV | |
if: matrix.scala.bincompat == '2.13' && matrix.framework.framework == 'dropwizard' | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: olafurpg/setup-scala@v14 | |
with: | |
java-version: zulu@${{ matrix.java }} | |
- name: print Java version | |
run: java -version | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.cache/coursier | |
key: ${{ runner.os }}-scala-${{ matrix.scala.version }}-${{ hashFiles('**/*.sbt') }} | |
restore-keys: | | |
${{ runner.os }}-scala-${{ matrix.scala.version }}- | |
- name: Compile in lieu of test suite (TODO) | |
if: ${{ env.combo_enabled == 'true' }} | |
run: sbt ++${{ matrix.scala.version }} clean compile | |
# - name: Run tests | |
# if: ${{ env.combo_enabled == 'true' }} | |
# run: sbt ++${{ matrix.scala.version }} clean coverage "runExample scala ${{ matrix.framework.framework }}" ${{ matrix.framework.project }}/test coverageAggregate | |
# - uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # 3.1.4 | |
# if: ${{ env.combo_enabled == 'true' }} | |
# with: | |
# file: ./target/scala-${{ matrix.scala.bincompat }}/scoverage-report/scoverage.xml | |
# fail_ci_if_error: true | |
# token: ${{ secrets.CODECOV_TOKEN }} |