Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: lihaoyi/mill-1
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: docs-query-cli
Choose a base ref
...
head repository: com-lihaoyi/mill
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
Loading
Showing 2,215 changed files with 83,747 additions and 36,611 deletions.
2 changes: 1 addition & 1 deletion .config/mill-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.12.2
0.12.9-3-a942e8-native
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -13,3 +13,16 @@ insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2

[*.{kt,kts}]
ktlint_code_style = intellij_idea
ktlint_standard_no-wildcard-imports = disabled

[example/kotlinlib/linting/**/*]
ktlint = disabled

[kotlinlib/test/resources/contrib/ktfmt/**/*]
ktlint = disabled

[kotlinlib/test/resources/kotlin-js/foo/test/src/foo/**/*]
ktlint = disabled
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -53,3 +53,5 @@ ceef92f5d6f3d4066564d41b5165351df7cb5fbb
# Format more code
39e36746ce8b5a254e0c276bc3cdbff9842d1224

# Format more code
3e2f5814b4524792c2c540599cddbd4e58240aad
5 changes: 4 additions & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
Please don't open issues for questions, but ask in our Discussions forum at https://github.com/com-lihaoyi/mill/discussions or Discord channel at https://discord.gg/xJCYRVMS
Please don't open issues for questions, but ask in our Discussions forum at https://github.com/com-lihaoyi/mill/discussions

Mill installations via `coursier` or `cs` are unsupported.

Please open all PRs as drafts to avoid being bottlenecked by Mill CI, and only
convert to ready for review once CI on your own fork is green. There will be a
PR status check linking your fork's commit/CI history for convenient viewing
4 changes: 4 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Please open all PRs as drafts and ensure that your fork of Mill has
`settings/actions` / `Allow all actions and reusable workflows` enabled to run CI on
your own fork of the Mill repo. Only once CI passes mark the PR as `Ready for review`
and CI will run on the main Mill repo before we merge it.
54 changes: 54 additions & 0 deletions .github/actions/post-build-selective/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# action.yml
inputs:
millargs:
default: ''
type: string

shell:
required: true
type: string

coursierarchive:
default: ''
type: string

runs:
using: "composite"
steps:
- uses: actions/setup-node@v4
with: { node-version: '22' }

- run: cat .mill-jvm-version
shell: ${{ inputs.shell }}

- run: ./mill -i -k selective.resolve ${{ inputs.millargs }}
shell: ${{ inputs.shell }}

# This generates a lot of logs and slows down the github actions UI like crazy,
# so only uncomment it when really necessary
#- run: cat out/mill-build/codeSignatures.dest/current/spanningInvalidationTree.json
# shell: bash

- run: ./mill -i -k selective.resolveTree ${{ inputs.millargs }}
shell: ${{ inputs.shell }}

# Comment this out because it can be very verbose when broad codesig
# invalidation results in all tasks being counted as changed inputs
#- run: ./mill -i -k selective.resolveChanged ${{ inputs.millargs }}
# shell: ${{ inputs.shell }}

- run: ./mill -i -k selective.run ${{ inputs.millargs }}
env:
COURSIER_ARCHIVE_CACHE: ${{ inputs.coursierarchive }}
shell: ${{ inputs.shell }}

- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
if: always() # always run even if the previous step fails
with:
fail_on_failure: false
include_passed: false
detailed_summary: true
annotate_only: true
require_tests: false
report_paths: 'out/**/test-report.xml'
38 changes: 38 additions & 0 deletions .github/actions/post-build-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# action.yml
inputs:
java-version:
required: true
type: string

timeout-minutes:
default: 60
type: number

os:
type: string

runs:
using: "composite"
steps:
- run: echo temurin:${{ inputs.java-version }} > .mill-jvm-version
shell: bash

# Need to fix cached artifact file permissions because github actions screws it up
# https://github.com/actions/upload-artifact/issues/38
- run: "chmod -R 777 ."
shell: bash

- run: git config --global user.email "you@example.com"
shell: bash

- run: git config --global user.name "Your Name"
shell: bash

- uses: actions/download-artifact@v4
with:
path: out/mill-selective-execution
name: ${{ inputs.os }}-selective-execution-artifact

- run: mv out/mill-selective-execution/mill-selective-execution.json out/mill-selective-execution.json
shell: bash

68 changes: 68 additions & 0 deletions .github/actions/pre-build-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# action.yml
inputs:
java-version:
required: true
type: string

shell:
required: true
type: string

prepareargs:
default: "__"
type: string

os:
type: string

runs:
using: "composite"
steps:
# For normal PR jobs, just checkout the base_ref the PR is against
- uses: actions/checkout@v4
with:
ref: ${{ github.base_ref }}
if: ${{ !(github.event_name == 'push' && github.repository != 'com-lihaoyi/mill') }}

# For fork push jobs, first checkout the version being pushed, then look for the
# merge-base where the current version forks off from the upstream main branch
- uses: actions/checkout@v4
with: { fetch-depth: 0 }
if: ${{ github.event_name == 'push' && github.repository != 'com-lihaoyi/mill' }}

- run: |
git fetch https://github.com/com-lihaoyi/mill main
MERGE_BASE=$(git merge-base FETCH_HEAD HEAD)
# pretty-print the path between the FETCH_HEAD (main), HEAD, and the merge-base
git log --graph --pretty=format:"%h %d %ar %s %n" --ancestry-path $MERGE_BASE^1..HEAD --ancestry-path $MERGE_BASE^1..FETCH_HEAD
git checkout $MERGE_BASE
shell: bash
if: ${{ github.event_name == 'push' && github.repository != 'com-lihaoyi/mill' }}
- run: echo temurin:${{ inputs.java-version }} > .mill-jvm-version
shell: bash

- run: chmod -R 777 . # normalize permissions before and after upload/download-artifact
shell: bash

- run: mkdir out && touch out/mill-selective-execution.json
shell: bash

- run: cat .mill-jvm-version
shell: bash

- run: ./mill -i -k selective.prepare ${{ inputs.prepareargs }}
if: ${{ (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'run-all-tests')) || github.repository != 'com-lihaoyi/mill' }}
shell: ${{ inputs.shell }}

- uses: actions/upload-artifact@v4.6.0
with:
path: out/mill-selective-execution.json
name: ${{ inputs.os }}-selective-execution-artifact
include-hidden-files: true

- uses: actions/checkout@v4

- run: echo temurin:${{ inputs.java-version }} > .mill-jvm-version
shell: bash
27 changes: 27 additions & 0 deletions .github/actions/setup-android/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# action.yml

runs:
using: "composite"
steps:
- uses: android-actions/setup-android@v3
with:
log-accepted-android-sdk-licenses: false
cmdline-tools-version: 11076708
packages: tools platform-tools emulator system-images;android-35;google_apis_playstore;x86_64

- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
shell: bash

- name: Cleanup any previous avd's to avoid signing key conflicts
run: rm -rf /home/runner/.config/.android/avd
shell: bash


- name: Set AVD environment variable globally
run: echo "ANDROID_AVD_HOME=/home/runner/.config/.android/avd" >> $GITHUB_ENV
shell: bash

16 changes: 16 additions & 0 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'autofix.ci'
on:
pull_request:
jobs:
autofix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: sbt/setup-sbt@v1

- run: |
./mill __.fix + mill.javalib.palantirformat.PalantirFormatModule/ + mill.scalalib.scalafmt.ScalafmtModule/ + mill.kotlinlib.ktlint.KtlintModule/
./mill --meta-level 1 mill.scalalib.scalafmt.ScalafmtModule/
- uses: autofix-ci/action@551dded8c6cc8a1054039c8bc0b8b48c51dfc6ef
31 changes: 31 additions & 0 deletions .github/workflows/draft-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Draft CI

permissions: write-all
on:
pull_request_target:
types:
- opened
- reopened
- synchronize
- ready_for_review

jobs:
run:
runs-on: ubuntu-latest
permissions: write-all
steps:
# We want to always create a status, even if the PR is not a draft, so that
# if there was a previous `pending` draft status it can get over-written by a
# `success` when it is ready for review
- run: |
curl --request POST \
--url ${{ github.event.pull_request.statuses_url }} \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"state": "${{(github.event.action != 'ready_for_review' && github.event.pull_request.draft) && 'pending' || 'success'}}",
"context": "Draft CI",
"target_url": ${{(github.event.action != 'ready_for_review' && github.event.pull_request.draft) && format('"{0}/commits/{1}"', github.event.pull_request.head.repo.html_url, github.event.pull_request.head.ref) || 'null'}},
"description": "${{(github.event.action != 'ready_for_review' && github.event.pull_request.draft) && 'use CI on your repo fork (link on right) until this PR is ready for review' || 'PR is ready for review, running CI in Mill repo'}}"
}' \
--fail-with-body
34 changes: 34 additions & 0 deletions .github/workflows/post-build-raw.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: post-build-raw
on:
workflow_call:
inputs:
buildcmd:
default: ''
type: string
java-version:
required: true
type: string
os:
default: 'ubuntu-latest'
type: string
timeout-minutes:
default: 60
type: number

jobs:
run:
runs-on: ${{ inputs.os }}
continue-on-error: false
timeout-minutes: ${{ inputs.timeout-minutes }}
steps:
- uses: actions/download-artifact@v4
with:
path: .
name: ${{ inputs.os }}-artifact

- uses: ./.github/actions/post-build-setup
with:
java-version: ${{ inputs.java-version }}
os: ${{ inputs.os }}

- run: ${{ inputs.buildcmd }}
63 changes: 63 additions & 0 deletions .github/workflows/post-build-selective.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: post-build-selective
on:
workflow_call:
inputs:
millargs:
default: ''
type: string

shell:
required: true
type: string

coursierarchive:
default: "/tmp"
required: false
type: string
java-version:
required: true
type: string
os:
default: 'ubuntu-latest'
type: string
timeout-minutes:
default: 60
type: number
install-android-sdk:
default: false
type: boolean
install-sbt:
default: false
type: boolean

jobs:
run:
runs-on: ${{ inputs.os }}
continue-on-error: false
timeout-minutes: ${{ inputs.timeout-minutes }}
steps:
- uses: coursier/cache-action@v6

- uses: actions/download-artifact@v4
with:
path: .
name: ${{ inputs.os }}-artifact

- uses: ./.github/actions/post-build-setup
with:
java-version: ${{ inputs.java-version }}
os: ${{ inputs.os }}

- uses: ./.github/actions/setup-android
if: ${{ inputs.install-android-sdk }}

- uses: sbt/setup-sbt@v1
if: ${{ inputs.install-sbt }}

- uses: ./.github/actions/post-build-selective

with:
millargs: ${{ inputs.millargs }}
coursierarchive: ${{ inputs.coursierarchive }}
install-android-sdk: ${{ inputs.install-android-sdk }}
shell: ${{ inputs.shell }}
Loading