Use OS-Lib's pwdDynamicFunction
to allow sandboxing of os.pwd
, write sandboxing doc page, introduce RunModule#runner
#7929
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: CI | |
# We run full CI on push builds to main and on all pull requests | |
# | |
# Tags are automatically published | |
# | |
# Manual builds (workflow_dispatch) to the main branch are also published | |
# | |
# To maximize bug-catching changes while keeping CI times reasonable, we run: | |
# - All tests on Linux/Java17 | |
# - Fewer tests on Linux/Java8 and Windows/Java17 | |
# - Fewest tests on Windows/Java8 | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '**' | |
pull_request: | |
merge_group: | |
workflow_dispatch: | |
# cancel older runs of a pull request; | |
# this will not cancel anything for normal git pushes | |
concurrency: | |
group: cancel-old-pr-runs-${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
build-linux: | |
uses: ./.github/workflows/run-mill-action.yml | |
with: | |
java-version: 11 | |
millargs: __.compile | |
populate_cache: true | |
build-windows: | |
uses: ./.github/workflows/run-mill-action.yml | |
with: | |
os: windows-latest | |
java-version: 11 | |
millargs: __.compile | |
populate_cache: true | |
itest: | |
needs: build-linux | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# bootstrap tests | |
- java-version: 11 # Have one job on oldest JVM | |
buildcmd: ci/test-mill-dev.sh && ci/test-mill-release.sh && ./mill -i -k __.ivyDepsTree && ./mill -i -k __.ivyDepsTree --withRuntime | |
- java-version: 17 # Have one job on default JVM | |
buildcmd: ci/test-mill-bootstrap.sh | |
uses: ./.github/workflows/run-mill-action.yml | |
with: | |
java-version: ${{ matrix.java-version }} | |
buildcmd: ${{ matrix.buildcmd }} | |
linux: | |
needs: build-linux | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# For most tests, run them arbitrarily on Java 11 or Java 17 on Linux, and | |
# on the opposite version on Windows below, so we get decent coverage of | |
# each test on each Java version and each operating system | |
# We also try to group tests together to manuaully balance out the runtimes of each jobs | |
- java-version: 17 | |
millargs: "'{main,scalalib,testrunner,bsp,testkit}.__.testCached'" | |
- java-version: 11 | |
millargs: "'{scalajslib,scalanativelib}.__.testCached'" | |
- java-version: 17 | |
millargs: "contrib.__.testCached" | |
- java-version: 17 | |
millargs: "'example.javalib.__.local.testCached'" | |
- java-version: 17 | |
millargs: "'example.scalalib.__.local.testCached'" | |
- java-version: 11 | |
millargs: "'example.thirdparty[{mockito,acyclic,commons-io}].local.testCached'" | |
- java-version: 17 | |
millargs: "'example.thirdparty[{fansi,jimfs,netty,gatling}].local.testCached'" | |
- java-version: 11 | |
millargs: "'example.{depth,extending}.__.local.testCached'" | |
# Most of these integration tests should not depend on which mode they | |
# are run in, so just run them in `local` | |
- java-version: 11 | |
millargs: "'integration.{failure,feature,ide}.__.local.testCached'" | |
# These invalidation tests need to be exercised in both execution modes | |
# to make sure they work with and without -i/--no-server being passed | |
- java-version: 17 | |
millargs: "'integration.invalidation.__.fork.testCached'" | |
- java-version: 17 | |
millargs: "'integration.invalidation.__.server.testCached'" | |
# Check docsite compiles | |
- java-version: 11 | |
buildcmd: git fetch --tags && ./mill -i docs.githubPages | |
uses: ./.github/workflows/run-mill-action.yml | |
with: | |
java-version: ${{ matrix.java-version }} | |
millargs: ${{ matrix.millargs }} | |
compiler-bridge: | |
needs: build-linux | |
uses: ./.github/workflows/run-mill-action.yml | |
with: | |
java-version: '8' | |
millargs: bridge.__.publishLocal | |
env-bridge-versions: 'essential' | |
format-scalafix-bincompat: | |
needs: build-linux | |
uses: ./.github/workflows/run-mill-action.yml | |
with: | |
java-version: '11' | |
buildcmd: ./mill -i mill.scalalib.scalafmt.ScalafmtModule/checkFormatAll __.sources + __.mimaReportBinaryIssues + __.fix --check | |
windows: | |
needs: build-windows | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# just run a subset of examples/ on Windows, because for some reason running | |
# the whole suite can take hours on windows v.s. half an hour on linux | |
- java-version: 11 | |
millargs: '"{main,scalalib,bsp}.__.testCached"' | |
- java-version: 11 | |
millargs: '"example.scalalib.{basic,web}.__.fork.testCached"' | |
- java-version: 17 | |
millargs: "'integration.{feature,failure}[_].fork.testCached'" | |
- java-version: 11 | |
millargs: "'integration.invalidation[_].server.testCached'" | |
- java-version: 11 | |
millargs: "contrib.__.testCached" | |
uses: ./.github/workflows/run-mill-action.yml | |
with: | |
os: windows-latest | |
java-version: ${{ matrix.java-version }} | |
millargs: ${{ matrix.millargs }} | |
publish-sonatype: | |
# when in master repo, publish all tags and manual runs on main | |
if: github.repository == 'com-lihaoyi/mill' && (startsWith( github.ref, 'refs/tags/') || (github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch' ) ) | |
needs: [linux, windows, compiler-bridge, format-scalafix-bincompat, itest] | |
runs-on: ubuntu-latest | |
# only run one publish job for the same sha at the same time | |
# e.g. when a main-branch push is also tagged | |
concurrency: publish-sonatype-${{ github.sha }} | |
env: | |
SONATYPE_PGP_SECRET: ${{ secrets.SONATYPE_PGP_SECRET }} | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_DEPLOY_USER }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_DEPLOY_PASSWORD }} | |
SONATYPE_PGP_PASSWORD: ${{ secrets.SONATYPE_PGP_PASSWORD }} | |
LANG: "en_US.UTF-8" | |
LC_MESSAGES: "en_US.UTF-8" | |
LC_ALL: "en_US.UTF-8" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: coursier/cache-action@v6 | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: 8 | |
distribution: temurin | |
- run: ci/release-maven.sh | |
release-github: | |
# when in master repo, publish all tags and manual runs on main | |
if: github.repository == 'com-lihaoyi/mill' && (startsWith( github.ref, 'refs/tags/') || (github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch' ) ) | |
needs: publish-sonatype | |
runs-on: ubuntu-latest | |
env: | |
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: coursier/cache-action@v6 | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: 8 | |
distribution: temurin | |
- run: ./mill -i uploadToGithub $REPO_ACCESS_TOKEN |