Skip to content

Commit e3fcc62

Browse files
committed
.
1 parent 5468410 commit e3fcc62

File tree

2 files changed

+64
-18
lines changed

2 files changed

+64
-18
lines changed

.github/workflows/pre-build.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ jobs:
2626
- uses: actions/checkout@v4
2727
with: { fetch-depth: 1 }
2828

29+
# For normal PR jobs, just checkout the base_ref the PR is against
30+
- uses: actions/checkout@v4
31+
with:
32+
ref: ${{ github.base_ref }}
33+
if: ${{ !(github.event_name == 'push' && github.repository != 'com-lihaoyi/mill') }}
34+
2935
- run: |
3036
git fetch https://github.com/com-lihaoyi/mill main
3137
MERGE_BASE=$(git merge-base FETCH_HEAD HEAD)
@@ -45,8 +51,12 @@ jobs:
4551
- run: cat .mill-jvm-version
4652

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

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

5161
- 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"]'
5262
- 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"]'
@@ -55,6 +65,14 @@ jobs:
5565

5666
- uses: actions/checkout@v4
5767

68+
- uses: actions/download-artifact@v4
69+
with:
70+
path: out/mill-selective-execution
71+
name: ${{ inputs.os }}-selective-execution-artifact
72+
73+
- run: mv out/mill-selective-execution/mill-selective-execution.json out/mill-selective-execution.json
74+
shell: bash
75+
5876
- run: ./mill -i --debug -k ${{ inputs.compileargs }}
5977

6078
- 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"]'

.github/workflows/run-tests.yml

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -77,38 +77,66 @@ jobs:
7777
# in the list should be the one that's most worth looking into
7878
build-linux:
7979
if: (github.event.action == 'ready_for_review') || (github.event.pull_request.draft == false)
80-
uses: ./.github/workflows/pre-build.yml
81-
with:
82-
os: ubuntu-latest
83-
shell: bash
84-
85-
linux:
86-
needs: build-linux
8780
runs-on: ubuntu-latest
8881
steps:
89-
- uses: coursier/cache-action@v6
82+
# For normal PR jobs, just checkout the base_ref the PR is against
83+
- uses: actions/checkout@v4
84+
with: { fetch-depth: 1 }
9085

91-
- uses: actions/download-artifact@v4
86+
# For normal PR jobs, just checkout the base_ref the PR is against
87+
- uses: actions/checkout@v4
9288
with:
93-
path: .
94-
name: ubuntu-latest-artifact
89+
ref: ${{ github.base_ref }}
90+
if: ${{ !(github.event_name == 'push' && github.repository != 'com-lihaoyi/mill') }}
91+
92+
- run: |
93+
git fetch https://github.com/com-lihaoyi/mill main
94+
MERGE_BASE=$(git merge-base FETCH_HEAD HEAD)
95+
# pretty-print the path between the FETCH_HEAD (main), HEAD, and the merge-base
96+
git log --graph --pretty=format:"%h %d %ar %s %n" --ancestry-path $MERGE_BASE^1..HEAD --ancestry-path $MERGE_BASE^1..FETCH_HEAD
97+
98+
git checkout $MERGE_BASE
99+
shell: bash
100+
if: ${{ github.event_name == 'push' && github.repository != 'com-lihaoyi/mill' }}
101+
102+
- run: echo temurin:17 > .mill-jvm-version
95103

96-
- uses: ./.github/actions/post-build-setup
104+
- run: chmod -R 777 . # normalize permissions before and after upload/download-artifact
105+
106+
- run: mkdir out && touch out/mill-selective-execution.json
107+
108+
- run: cat .mill-jvm-version
109+
110+
- run: ./mill -i --debug -k selective.prepare
111+
112+
- uses: actions/[email protected]
97113
with:
98-
java-version: 17
99-
os: ubuntu-latest
114+
path: out/mill-selective-execution.json
115+
name: ubuntu-latest-selective-execution-artifact
116+
include-hidden-files: true
100117

101118
- 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"]'
102119
- 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"]'
103120
- 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"]'
104121
- 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"]'
105122

106-
- run: ./mill -i --debug -k selective.resolve 'example.javalib.basic[1-simple].native.server.test'
107-
- run: ./mill -i --debug -k selective.resolveTree 'example.javalib.basic[1-simple].native.server.test'
108-
- run: ./mill -i --debug -k selective.resolveChanged 'example.javalib.basic[1-simple].native.server.test'
123+
- uses: actions/checkout@v4
124+
125+
- uses: actions/download-artifact@v4
126+
with:
127+
path: out/mill-selective-execution
128+
name: ubuntu-latest-selective-execution-artifact
129+
130+
- run: mv out/mill-selective-execution/mill-selective-execution.json out/mill-selective-execution.json
131+
shell: bash
132+
133+
- run: ./mill -i --debug -k __.compile
109134

110135
- 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"]'
111136
- 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"]'
112137
- 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"]'
113138
- 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"]'
114139

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

0 commit comments

Comments
 (0)