Skip to content

Run tests Windows

Run tests Windows #158

name: Run tests Windows
on:
workflow_call:
pull_request:
schedule:
# Every day at 2 AM UTC
- cron: "0 2 * * *"
workflow_dispatch:
concurrency:
group: windows-${{ github.head_ref }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
test-runtime:
name: Test runtime
if: "github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' || ((github.event_name == 'schedule' || github.event_name == 'workflow_call') && github.repository == 'scala-native/scala-native')"
runs-on: windows-2022
env:
ENABLE_EXPERIMENTAL_COMPILER: true
strategy:
fail-fast: false
matrix:
scala: [3]
gc: [none, boehm, immix, commix]
include:
- scala: 3-next
gc: immix
- scala: 2.13
gc: immix
- scala: 2.12
gc: immix
steps:
# Disable autocrlf setting, otherwise scalalib patches might not be possible to apply
- name: Setup git config
run: git config --global core.autocrlf false
- uses: actions/checkout@v4
- uses: ./.github/actions/windows-setup-env
id: setup
with:
scala-version: ${{matrix.scala}}
# None GC takes too much memory on Windows to execute partest JUnit tests
# leading to spurious failures in the CI. Perform subset of tests instead
# Execution with enabled multithreading increases memory usage, run only minimal tests
- name: Test runtime None GC
if: matrix.gc == 'none'
timeout-minutes: 45
run: >
set SCALANATIVE_GC=${{matrix.gc}}&
set SCALANATIVE_INCLUDE_DIRS=${{steps.setup.outputs.vcpkg-dir}}\include&
set SCALANATIVE_LIB_DIRS=${{steps.setup.outputs.vcpkg-dir}}\lib&
set SCALANATIVE_TEST_PREFETCH_DEBUG_INFO=1&
set SCALANATIVE &
sbt
sandbox${{env.project-version}}/run
testsExt${{env.project-version}}/test
"scalaPartestTests${{env.project-version}}/testOnly -- --showDiff neg/abstract.scala pos/abstract.scala run/Course-2002-01.scala"
shell: cmd
- name: Test runtime
if: matrix.gc != 'none'
timeout-minutes: 45
run: >
set SCALANATIVE_GC=${{matrix.gc}}&
set SCALANATIVE_INCLUDE_DIRS=${{steps.setup.outputs.vcpkg-dir}}\include&
set SCALANATIVE_LIB_DIRS=${{steps.setup.outputs.vcpkg-dir}}\lib&
set SCALANATIVE_TEST_PREFETCH_DEBUG_INFO=1&
set SCALANATIVE &
sbt
"test-runtime ${{matrix.scala}}"
"scalaPartestTests${{env.project-version}}/testOnly -- --showDiff neg/abstract.scala pos/abstract.scala run/Course-2002-01.scala"
shell: cmd
run-scripted-tests:
name: Scripted tests
if: "github.event_name == 'pull_request' || ((github.event_name == 'schedule' || github.event_name == 'workflow_call') && github.repository == 'scala-native/scala-native')"
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
scala: [2.12, 3]
steps:
# Disable autocrlf setting, otherwise scalalib patches might not be possible to apply
- name: Setup git config
run: git config --global core.autocrlf false
- uses: actions/checkout@v4
- uses: ./.github/actions/windows-setup-env
with:
scala-version: ${{matrix.scala}}
- name: Test scripted
run: sbt "test-scripted ${{matrix.scala}}"
shell: cmd
test-runtime-ext:
name: Test runtime extension
if: "(github.event_name == 'schedule' || github.event_name == 'workflow_call') && github.repository == 'scala-native/scala-native'"
runs-on: windows-2022
env:
ENABLE_EXPERIMENTAL_COMPILER: true
needs: [test-runtime]
strategy:
fail-fast: false
matrix:
scala: [3, 3-next, 2.13]
build-mode: [debug, release-fast]
lto: [none, thin]
gc: [boehm, immix, commix]
exclude:
# Covered in basic test-runtime
- scala: 3
build-mode: debug
- scala: 2.13
build-mode: debug
gc: immix
- build-mode: release-fast
lto: none
include:
- scala: 3
build-mode: release-size
lto: thin
gc: immix
# ReleaseFull is flaky
# - scala: 3
# build-mode: release-full
# lto: thin
# gc: commix
steps:
# Disable autocrlf setting, otherwise scalalib patches might not be possible to apply
- name: Setup git config
run: git config --global core.autocrlf false
- uses: actions/checkout@v4
- uses: ./.github/actions/windows-setup-env
id: setup
with:
scala-version: ${{matrix.scala}}
- name: Run tests
timeout-minutes: 45
run: >
set SCALANATIVE_GC=${{matrix.gc}}&
set SCALANATIVE_MODE=${{matrix.build-mode}}&
set SCALANATIVE_LTO=${{matrix.lto}}&
set SCALANATIVE_INCLUDE_DIRS=${{steps.setup.outputs.vcpkg-dir}}\include&
set SCALANATIVE_LIB_DIRS=${{steps.setup.outputs.vcpkg-dir}}\lib&
set SCALANATIVE_TEST_PREFETCH_DEBUG_INFO=1&
set SCALANATIVE_CI_NO_DEBUG_SYMBOLS=true&
set SCALANATIVE &
sbt "test-runtime ${{matrix.scala}}"
shell: cmd
test-llvm-versions:
runs-on: windows-2022
if: "(github.event_name == 'schedule' || github.event_name == 'workflow_call') && github.repository == 'scala-native/scala-native'"
strategy:
fail-fast: false
matrix:
scala: [3]
llvm: ["16.0.6", "17.0.6"] # Last 2 stable versions, LLVM 16 is minimal version able to compile current Windows SDK
steps:
- name: Setup git config
run: git config --global core.autocrlf false
- uses: actions/checkout@v4
- uses: ./.github/actions/windows-setup-env
id: setup
with:
scala-version: ${{matrix.scala}}
llvm-version: ${{ matrix.llvm }}
java-version: 8
- name: Run tests
shell: cmd
timeout-minutes: 45
run: >
set SCALANATIVE_INCLUDE_DIRS=${{steps.setup.outputs.vcpkg-dir}}\include&
set SCALANATIVE_LIB_DIRS=${{steps.setup.outputs.vcpkg-dir}}\lib&
set SCALANATIVE &
sbt "show tests3/nativeConfig" "test-runtime ${{matrix.scala}}"