Skip to content

chore: Drop Scala 2.12 #926

chore: Drop Scala 2.12

chore: Drop Scala 2.12 #926

name: Validate and test
on:
pull_request:
push:
branches: [ main ]
tags-ignore: [ v* ]
permissions:
contents: read
concurrency:
# Only run once for latest commit per ref and cancel other (previous) runs.
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
formatting-check:
name: Checks
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3.1.0
- name: Cache Coursier cache
uses: coursier/cache-action@v6.4.0
- name: Set up JDK 17
uses: coursier/setup-action@v1.3.0
with:
jvm: temurin:1.17
- name: Cache Build Target
uses: actions/cache@v3.0.11
with:
path: project/**/target
key: build-target-${{ hashFiles('**/*.sbt', 'project/build.properties', 'project/**/*.scala') }}
- name: Autoformat
run: sbt +headerCreateAll +scalariformFormat +test:scalariformFormat
- name: Check for missing formatting
run: git diff --exit-code --color
compile-and-test:
name: Compile and test
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix: # align with publish-test-reports.yml
SCALA_VERSION: [2.13, 3.3]
JDK_VERSION: ["1.8", "1.11", "1.17"]
include:
- JDK_VERSION: 1.8
JVM_NAME: temurin:1.8
extraOpts: '-J-Xmx2048M'
- JDK_VERSION: 1.11
JVM_NAME: temurin:1.11
extraOpts: ''
- JDK_VERSION: 1.17
JVM_NAME: temurin:1.17
extraOpts: ''
steps:
- name: Checkout
uses: actions/checkout@v3.1.0
with:
fetch-depth: 0
- name: Cache Coursier cache
uses: coursier/cache-action@v6.4.0
- name: Set up JDK ${{ matrix.JDK_VERSION }}
uses: coursier/setup-action@v1.3.0
with:
jvm: ${{ matrix.JVM_NAME }}
- name: Cache Build Target
uses: actions/cache@v3.0.11
with:
path: project/**/target
key: build-target-${{ hashFiles('**/*.sbt', 'project/build.properties', 'project/**/*.scala') }}
- name: Compile everything
run: sbt ++${{ matrix.SCALA_VERSION }} Test/compile ${{ matrix.extraOpts }}
# Quick testing for PR validation
- name: Validate pull request for JDK ${{ matrix.JDK_VERSION }}, Scala ${{ matrix.SCALA_VERSION }}
if: ${{ github.event_name == 'pull_request' }}
run: sbt -Dakka.http.parallelExecution=false -Dakka.test.timefactor=2 ++${{ matrix.SCALA_VERSION }} validatePullRequest ${{ matrix.extraOpts }}
# Full testing for pushes
- name: Run all tests JDK ${{ matrix.JDK_VERSION }}, Scala ${{ matrix.SCALA_VERSION }}
if: ${{ github.event_name == 'push' }}
run: sbt -Dakka.http.parallelExecution=false -Dakka.test.timefactor=2 ++${{ matrix.SCALA_VERSION }} mimaReportBinaryIssues test ${{ matrix.extraOpts }}
- name: Upload test results
uses: actions/upload-artifact@v3.1.1
if: success() || failure() # run this step even if previous step failed
with:
name: 'test-results-${{ matrix.JDK_VERSION }}-${{ matrix.SCALA_VERSION }}'
path: '**/target/test-reports/*.xml'