Skip to content

Drop dependency on the main coursier module #2372

Drop dependency on the main coursier module

Drop dependency on the main coursier module #2372

Workflow file for this run

name: CI
on:
push:
branches:
- main
tags:
- "v*"
pull_request:
jobs:
scala-versions:
runs-on: ubuntu-latest
outputs:
json: ${{ steps.versions.outputs.json }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: true
- uses: coursier/setup-action@v3.0
with:
jvm: 21
- id: versions
run: echo "json=$(./mill -i dev.ciScalaVersionsJson)" >> "$GITHUB_OUTPUT"
examples:
runs-on: ${{ matrix.OS }}
strategy:
fail-fast: false
matrix:
OS: ["ubuntu-latest", "windows-latest"]
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: true
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.10"
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install -r examples/requirements.txt --no-dependencies
- uses: coursier/setup-action@v3.0
with:
jvm: 21
- run: ./mill -i scala.examples.test
test:
needs: scala-versions
runs-on: ${{ matrix.OS }}
strategy:
fail-fast: false
matrix:
OS: [ubuntu-latest]
SCALA: ${{ fromJSON(needs.scala-versions.outputs.json).all }}
include:
- OS: windows-latest
SCALA: ${{ fromJSON(needs.scala-versions.outputs.json).scala213 }}
- OS: macos-15
SCALA: ${{ fromJSON(needs.scala-versions.outputs.json).scala213 }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: true
- uses: coursier/setup-action@v3.0
with:
jvm: 21
apps:
# Modules are built once per binary Scala version, and their tests once per full Scala
# version - the former selector runs the tests of the modules that have no full Scala
# version cross, the latter the tests of those that do. The latter names the test task
# explicitly, so that modules that merely happen to be named "test" are left out.
- run: |
./mill -i "__[$BINARY_SCALA].test"
./mill -i "__.test[$SCALA].testForked"
shell: bash
if: runner.os != 'Windows'
env:
SCALA: ${{ matrix.SCALA.scalaVersion }}
BINARY_SCALA: ${{ matrix.SCALA.binaryScalaVersion }}
- run: |
./mill -i __[%BINARY_SCALA%].test
./mill -i __.test[%SCALA%].testForked
if: runner.os == 'Windows'
env:
SCALA: ${{ matrix.SCALA.scalaVersion }}
BINARY_SCALA: ${{ matrix.SCALA.binaryScalaVersion }}
echo:
# The echo demo kernel is built for Scala 3 only, so the cross-version test job above
# doesn't pick its tests up.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: true
- uses: coursier/setup-action@v3.0
with:
jvm: 21
apps:
- run: ./mill -i echo.test
shell: bash
integration-tests:
runs-on: ${{ matrix.OS }}
# Room for the retry below to run the suite a second time on a transient infrastructure flake.
timeout-minutes: 150
strategy:
fail-fast: false
matrix:
OS: ["ubuntu-22.04", macos-15, windows-latest]
GROUP: ["212", "213", "3"]
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: true
- uses: coursier/setup-action@v3.0
with:
jvm: 21
apps: scala-cli
# Retry the whole suite once as a backstop: the integration tests occasionally hit transient
# infrastructure issues (overloaded runner, ZeroMQ connection timeouts) that the in-test retries
# don't fully absorb. This is a coarse safety net - the per-test retries and the ZeroMQ cleanup
# fixes in the test harness should keep it from triggering in the common case.
- name: Run integration tests
uses: nick-fields/retry@v4
with:
timeout_minutes: 75
max_attempts: 2
retry_on: error
shell: bash
command: .github/scripts/run/run-its.sh ${{ matrix.GROUP }}
bincompat:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: true
- uses: coursier/setup-action@v3.0
with:
jvm: 21
- run: ./mill __.mimaReportBinaryIssues
shell: bash
website:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: true
- uses: coursier/setup-action@v3.0
with:
jvm: 21
apps: cs
- run: ./mill docs.generate
shell: bash
format:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: true
- uses: coursier/setup-action@v3.0
with:
jvm: 21
apps: scalafmt
- run: scalafmt --check
publishLocal:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: true
- uses: coursier/setup-action@v3.0
with:
jvm: 21
apps:
- run: |
mv .mill-jvm-opts .mill-jvm-opts.bak
echo "-Xmx2g" > .mill-jvm-opts
cat .mill-jvm-opts.bak | grep -v Xmx >> .mill-jvm-opts
# sometimes running into memory issues when attempting __.publishLocal upfront
for SV in $(./mill -i dev.binaryScalaVersions); do
./mill -i '__['"$SV"'].compile'
./mill -i '__['"$SV"'].docJar'
./mill -i '__['"$SV"'].publishLocal'
done
./mill -i __.publishLocal
shell: bash