Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
lihaoyi committed Jan 27, 2025
1 parent 5468410 commit e3fcc62
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 18 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/pre-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ jobs:
- uses: actions/checkout@v4
with: { fetch-depth: 1 }

# 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') }}

- run: |
git fetch https://github.com/com-lihaoyi/mill main
MERGE_BASE=$(git merge-base FETCH_HEAD HEAD)
Expand All @@ -45,8 +51,12 @@ jobs:
- run: cat .mill-jvm-version

- run: ./mill -i --debug -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' }}

- uses: actions/[email protected]
with:
path: out/mill-selective-execution.json
name: ${{ inputs.os }}-selective-execution-artifact
include-hidden-files: true

- run: cat out/mill-build/methodCodeHashSignatures.dest/current/4-methodCodeHashes.json | jq '.["build_.dist.package_$native$.$anonfun$executableRaw$8(os.Path,scala.collection.immutable.Seq,java.io.OutputStream)void"]'
- run: cat out/mill-build/methodCodeHashSignatures.dest/current/7-transitiveCallGraphHashes.json | jq '.["build_.dist.package_$native$.$anonfun$executableRaw$8(os.Path,scala.collection.immutable.Seq,java.io.OutputStream)void"]'
Expand All @@ -55,6 +65,14 @@ jobs:

- uses: actions/checkout@v4

- 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

- run: ./mill -i --debug -k ${{ inputs.compileargs }}

- run: cat out/mill-build/methodCodeHashSignatures.dest/current/4-methodCodeHashes.json | jq '.["build_.dist.package_$native$.$anonfun$executableRaw$8(os.Path,scala.collection.immutable.Seq,java.io.OutputStream)void"]'
Expand Down
62 changes: 45 additions & 17 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,38 +77,66 @@ jobs:
# in the list should be the one that's most worth looking into
build-linux:
if: (github.event.action == 'ready_for_review') || (github.event.pull_request.draft == false)
uses: ./.github/workflows/pre-build.yml
with:
os: ubuntu-latest
shell: bash

linux:
needs: build-linux
runs-on: ubuntu-latest
steps:
- uses: coursier/cache-action@v6
# For normal PR jobs, just checkout the base_ref the PR is against
- uses: actions/checkout@v4
with: { fetch-depth: 1 }

- uses: actions/download-artifact@v4
# For normal PR jobs, just checkout the base_ref the PR is against
- uses: actions/checkout@v4
with:
path: .
name: ubuntu-latest-artifact
ref: ${{ github.base_ref }}
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:17 > .mill-jvm-version

- uses: ./.github/actions/post-build-setup
- run: chmod -R 777 . # normalize permissions before and after upload/download-artifact

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

- run: cat .mill-jvm-version

- run: ./mill -i --debug -k selective.prepare

- uses: actions/[email protected]
with:
java-version: 17
os: ubuntu-latest
path: out/mill-selective-execution.json
name: ubuntu-latest-selective-execution-artifact
include-hidden-files: true

- run: cat out/mill-build/methodCodeHashSignatures.dest/current/4-methodCodeHashes.json | jq '.["build_.dist.package_$native$.$anonfun$executableRaw$8(os.Path,scala.collection.immutable.Seq,java.io.OutputStream)void"]'
- run: cat out/mill-build/methodCodeHashSignatures.dest/current/7-transitiveCallGraphHashes.json | jq '.["build_.dist.package_$native$.$anonfun$executableRaw$8(os.Path,scala.collection.immutable.Seq,java.io.OutputStream)void"]'
- run: cat out/mill-build/methodCodeHashSignatures.json | jq '.["value"]["build_.dist.package_$native$.$anonfun$executableRaw$8(os.Path,scala.collection.immutable.Seq,java.io.OutputStream)void"]'
- run: cat out/mill-selective-execution.json | jq '.["methodCodeHashSignatures"]["build_.dist.package_$native$.$anonfun$executableRaw$8(os.Path,scala.collection.immutable.Seq,java.io.OutputStream)void"]'

- run: ./mill -i --debug -k selective.resolve 'example.javalib.basic[1-simple].native.server.test'
- run: ./mill -i --debug -k selective.resolveTree 'example.javalib.basic[1-simple].native.server.test'
- run: ./mill -i --debug -k selective.resolveChanged 'example.javalib.basic[1-simple].native.server.test'
- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
path: out/mill-selective-execution
name: ubuntu-latest-selective-execution-artifact

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

- run: ./mill -i --debug -k __.compile

- run: cat out/mill-build/methodCodeHashSignatures.dest/current/4-methodCodeHashes.json | jq '.["build_.dist.package_$native$.$anonfun$executableRaw$8(os.Path,scala.collection.immutable.Seq,java.io.OutputStream)void"]'
- run: cat out/mill-build/methodCodeHashSignatures.dest/current/7-transitiveCallGraphHashes.json | jq '.["build_.dist.package_$native$.$anonfun$executableRaw$8(os.Path,scala.collection.immutable.Seq,java.io.OutputStream)void"]'
- run: cat out/mill-build/methodCodeHashSignatures.json | jq '.["value"]["build_.dist.package_$native$.$anonfun$executableRaw$8(os.Path,scala.collection.immutable.Seq,java.io.OutputStream)void"]'
- run: cat out/mill-selective-execution.json | jq '.["methodCodeHashSignatures"]["build_.dist.package_$native$.$anonfun$executableRaw$8(os.Path,scala.collection.immutable.Seq,java.io.OutputStream)void"]'

- run: ./mill -i --debug -k selective.resolve 'example.javalib.basic[1-simple].native.server.test'
- run: ./mill -i --debug -k selective.resolveTree 'example.javalib.basic[1-simple].native.server.test'
- run: ./mill -i --debug -k selective.resolveChanged 'example.javalib.basic[1-simple].native.server.test'

0 comments on commit e3fcc62

Please sign in to comment.