-
-
Notifications
You must be signed in to change notification settings - Fork 347
102 lines (87 loc) · 2.89 KB
/
run-mill-action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Build with Mill
on:
workflow_call:
inputs:
buildcmd:
default: ''
type: string
millargs:
default: ''
type: string
java-version:
required: true
type: string
os:
default: 'ubuntu-latest'
type: string
continue-on-error:
default: false
type: boolean
populate_cache:
default: false
type: boolean
timeout-minutes:
default: 60
type: number
env-bridge-versions:
default: 'none'
type: string
install-android-sdk:
default: false
type: boolean
jobs:
run:
runs-on: ${{ inputs.os }}
continue-on-error: ${{ inputs.continue-on-error }}
timeout-minutes: ${{ inputs.timeout-minutes }}
env:
MILL_COMPILER_BRIDGE_VERSIONS: ${{ inputs.env-bridge-versions }}
steps:
- uses: actions/checkout@v4
if: ${{ inputs.populate_cache }}
- uses: actions/download-artifact@v4
if: ${{ !inputs.populate_cache }}
with:
path: .
name: ${{ inputs.os }}-artifact
# Need to fix cached artifact file permissions because github actions screws it up
# https://github.com/actions/upload-artifact/issues/38
- name: chmod executable
run: "chmod -R +x ."
- uses: coursier/cache-action@v6
- uses: actions/setup-java@v4
with:
java-version: ${{ inputs.java-version }}
distribution: temurin
- uses: actions/setup-node@v4
with:
node-version: '22'
- uses: android-actions/setup-android@v3
if: ${{ inputs.install-android-sdk }}
with:
log-accepted-android-sdk-licenses: false
- name: Prepare git config
run: |
git config --global user.name "Mill GithHub Actions"
git config --global user.email "mill-ci@localhost"
- name: Run '${{ inputs.buildcmd }}'
run: ${{ inputs.buildcmd }}
if: inputs.buildcmd != ''
- name: Run Mill '${{ inputs.millargs }}'
# Mill tests are pretty heavy so run them only 3x parallel on 4 core Github Actions runners
run: ./mill -i -j3 -k ${{ inputs.millargs }}
if: inputs.millargs != '' && !startsWith(inputs.os, 'windows')
- name: Run Mill (on Windows) '${{ inputs.millargs }}'
run: cmd /C %GITHUB_WORKSPACE%\ci\mill.bat -i -j3 -k ${{ inputs.millargs }}
if: inputs.millargs != '' && startsWith(inputs.os, 'windows')
- name: Run Mill (on Windows) Worker Cleanup
run: 'taskkill -f -im java* && rm -rf out/mill-server/*'
if: inputs.millargs != '' && startsWith(inputs.os, 'windows')
shell: bash
continue-on-error: true
- uses: actions/upload-artifact@v4.4.3
with:
path: .
name: ${{ inputs.os }}-artifact
include-hidden-files: true
if: ${{ inputs.populate_cache }}