Skip to content

Commit f3002cc

Browse files
committed
minimze-single-job
1 parent d6edc5a commit f3002cc

File tree

2 files changed

+40
-65
lines changed

2 files changed

+40
-65
lines changed

.github/actions/pre-build-setup/action.yml

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -18,58 +18,3 @@ inputs:
1818
runs:
1919
using: "composite"
2020
steps:
21-
# For normal PR jobs, just checkout the base_ref the PR is against
22-
- uses: actions/checkout@v4
23-
with:
24-
ref: ${{ github.base_ref }}
25-
if: ${{ !(github.event_name == 'push' && github.repository != 'com-lihaoyi/mill') }}
26-
27-
# For fork push jobs, first checkout the version being pushed, then look for the
28-
# merge-base where the current version forks off from the upstream main branch
29-
- uses: actions/checkout@v4
30-
with: { fetch-depth: 0 }
31-
if: ${{ github.event_name == 'push' && github.repository != 'com-lihaoyi/mill' }}
32-
33-
- run: |
34-
git fetch https://github.com/com-lihaoyi/mill main
35-
MERGE_BASE=$(git merge-base FETCH_HEAD HEAD)
36-
# pretty-print the path between the FETCH_HEAD (main), HEAD, and the merge-base
37-
git log --graph --pretty=format:"%h %d %ar %s %n" --ancestry-path $MERGE_BASE^1..HEAD --ancestry-path $MERGE_BASE^1..FETCH_HEAD
38-
39-
git checkout $MERGE_BASE
40-
shell: bash
41-
if: ${{ github.event_name == 'push' && github.repository != 'com-lihaoyi/mill' }}
42-
43-
- run: echo temurin:${{ inputs.java-version }} > .mill-jvm-version
44-
shell: bash
45-
46-
- run: chmod -R 777 . # normalize permissions before and after upload/download-artifact
47-
shell: bash
48-
49-
- run: mkdir out && touch out/mill-selective-execution.json
50-
shell: bash
51-
52-
- run: cat .mill-jvm-version
53-
shell: bash
54-
55-
- run: ./mill -i --debug -k selective.prepare ${{ inputs.prepareargs }}
56-
if: ${{ (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'run-all-tests')) || github.repository != 'com-lihaoyi/mill' }}
57-
shell: ${{ inputs.shell }}
58-
59-
60-
- 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"]'
61-
shell: bash
62-
- 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"]'
63-
shell: bash
64-
- 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"]'
65-
shell: bash
66-
- 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"]'
67-
shell: bash
68-
69-
- uses: actions/[email protected]
70-
with:
71-
path: out/mill-selective-execution.json
72-
name: ${{ inputs.os }}-selective-execution-artifact
73-
include-hidden-files: true
74-
75-
- uses: actions/checkout@v4

.github/workflows/pre-build.yml

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,52 @@ jobs:
2626
- uses: actions/checkout@v4
2727
with: { fetch-depth: 1 }
2828

29-
- uses: ./.github/actions/pre-build-setup
29+
# For normal PR jobs, just checkout the base_ref the PR is against
30+
- uses: actions/checkout@v4
3031
with:
31-
os: ${{ inputs.os }}
32-
java-version: ${{ inputs.java-version }}
33-
shell: ${{ inputs.shell }}
32+
ref: ${{ github.base_ref }}
33+
if: ${{ !(github.event_name == 'push' && github.repository != 'com-lihaoyi/mill') }}
3434

35-
- run: ./mill -i --debug -k ${{ inputs.compileargs }}
35+
# For fork push jobs, first checkout the version being pushed, then look for the
36+
# merge-base where the current version forks off from the upstream main branch
37+
- uses: actions/checkout@v4
38+
with: { fetch-depth: 0 }
39+
40+
- run: |
41+
git fetch https://github.com/com-lihaoyi/mill main
42+
MERGE_BASE=$(git merge-base FETCH_HEAD HEAD)
43+
# pretty-print the path between the FETCH_HEAD (main), HEAD, and the merge-base
44+
git log --graph --pretty=format:"%h %d %ar %s %n" --ancestry-path $MERGE_BASE^1..HEAD --ancestry-path $MERGE_BASE^1..FETCH_HEAD
45+
46+
git checkout $MERGE_BASE
47+
shell: bash
48+
49+
- run: echo temurin:${{ inputs.java-version }} > .mill-jvm-version
50+
51+
- run: chmod -R 777 . # normalize permissions before and after upload/download-artifact
52+
53+
- run: mkdir out && touch out/mill-selective-execution.json
54+
55+
- run: cat .mill-jvm-version
56+
57+
- run: ./mill -i --debug -k selective.prepare ${{ inputs.prepareargs }}
58+
if: ${{ (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'run-all-tests')) || github.repository != 'com-lihaoyi/mill' }}
3659

3760

3861
- 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"]'
3962
- 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"]'
4063
- 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"]'
4164
- 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"]'
4265

43-
- uses: actions/[email protected]
44-
with:
45-
path: .
46-
name: ${{ inputs.os }}-artifact
47-
include-hidden-files: true
66+
- uses: actions/checkout@v4
67+
68+
- run: ./mill -i --debug -k ${{ inputs.compileargs }}
69+
70+
- 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"]'
71+
- 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"]'
72+
- 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"]'
73+
- 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"]'
74+
75+
- run: ./mill -i --debug -k selective.resolve 'example.javalib.basic[1-simple].native.server.test'
76+
- run: ./mill -i --debug -k selective.resolveTree 'example.javalib.basic[1-simple].native.server.test'
77+
- run: ./mill -i --debug -k selective.resolveChanged 'example.javalib.basic[1-simple].native.server.test'

0 commit comments

Comments
 (0)