Enable all image tests on scala native #1419
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: Compile and Test | |
on: [push, pull_request] | |
env: | |
CI: true # disables SBT super shell which has problems with CI environments | |
jobs: | |
compile-lib: | |
name: Compile library and test | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
scala: ["3.3"] | |
platform: [JVM, JS, Native] | |
env: | |
SCALA_VERSION: ${{ matrix.scala }} | |
PROJECT: root${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 1.8 and SBT | |
uses: actions/setup-java@v2 | |
with: | |
distribution: temurin | |
java-version: 8 | |
- name: Cache Coursier | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cache/coursier | |
key: ${{ runner.os }}-coursier-${{ hashFiles('**/*.sbt') }} | |
- name: Cache SBT ivy cache | |
uses: actions/cache@v1 | |
with: | |
path: ~/.ivy2/cache | |
key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/build.sbt') }} | |
- name: Cache SBT | |
uses: actions/cache@v1 | |
with: | |
path: ~/.sbt | |
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }} | |
- name: Compile (Scala ${{ matrix.scala }} - ${{ matrix.platform }}) | |
run: sbt -J-Xmx3G -Dsbt.color=always ++$SCALA_VERSION $PROJECT/compile | |
- name: Install scala-native libraries | |
if: matrix.platform == 'native' | |
run: sudo apt-get update && sudo apt-get -y install libunwind-dev libre2-dev libsdl2-dev | |
- name: Compile tests (Scala ${{ matrix.scala }} - ${{ matrix.platform }}) | |
run: sbt -J-Xmx3G -Dsbt.color=always ++$SCALA_VERSION $PROJECT/test:compile | |
- name: Run tests (Scala ${{ matrix.scala }} - ${{ matrix.platform }}) | |
run: sbt -J-Xmx3G -Dsbt.color=always ++$SCALA_VERSION $PROJECT/test | |
compile-examples: | |
name: Compile examples | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 1.8 and SBT | |
uses: actions/setup-java@v2 | |
with: | |
distribution: temurin | |
java-version: 8 | |
- name: Cache Coursier | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cache/coursier | |
key: ${{ runner.os }}-coursier-${{ hashFiles('**/*.sbt') }} | |
- name: Cache SBT ivy cache | |
uses: actions/cache@v1 | |
with: | |
path: ~/.ivy2/cache | |
key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/build.sbt') }} | |
- name: Cache SBT | |
uses: actions/cache@v1 | |
with: | |
path: ~/.sbt | |
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }} | |
- name: Install Scala-CLI | |
run: | | |
curl -fL https://github.com/Virtuslab/scala-cli/releases/latest/download/scala-cli-x86_64-pc-linux.gz | gzip -d > scala-cli | |
chmod +x scala-cli | |
sudo mv scala-cli /usr/local/bin/scala-cli | |
- name: Compile examples (Release) | |
run: | | |
cd examples/release | |
ls | grep .sc | xargs scala-cli compile | |
- name: Publish Local | |
run: sbt -J-Xmx3G -Dsbt.color=always publishLocal | |
- name: Compile examples (Snapshot) | |
run: | | |
cd examples/snapshot | |
ls | grep .sc | xargs scala-cli compile | |
coverage: | |
name: Code coverage | |
runs-on: ubuntu-latest | |
env: | |
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 1.8 and SBT | |
uses: actions/setup-java@v2 | |
with: | |
distribution: temurin | |
java-version: 8 | |
- name: Cache Coursier | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cache/coursier | |
key: ${{ runner.os }}-coursier-${{ hashFiles('**/*.sbt') }} | |
- name: Cache SBT ivy cache | |
uses: actions/cache@v1 | |
with: | |
path: ~/.ivy2/cache | |
key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/build.sbt') }} | |
- name: Cache SBT | |
uses: actions/cache@v1 | |
with: | |
path: ~/.sbt | |
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }} | |
- name: Compute coverage | |
run: sbt -J-Xmx3G -Dsbt.color=always rootJVM/clean coverage rootJVM/test rootJVM/coverageAggregate | |
- name: Upload report | |
run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r jvm/target/scala-3.3.1/coverage-report/cobertura.xml |