forked from MLton/mlton
-
Notifications
You must be signed in to change notification settings - Fork 1
160 lines (141 loc) · 4.48 KB
/
ci.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: CI
# Controls when the workflow will run
on:
push:
pull_request:
workflow_dispatch:
jobs:
build-test:
strategy:
fail-fast: false
matrix:
include:
- runner: "ubuntu-24.04"
cc: "gcc"
codegen: "amd64"
- runner: "ubuntu-24.04"
cc: "gcc"
codegen: "c"
- runner: "ubuntu-24.04"
cc: "clang"
codegen: "amd64"
- runner: "ubuntu-24.04"
cc: "clang"
codegen: "c"
- runner: "ubuntu-24.04"
cc: "clang"
codegen: "llvm"
- runner: "macos-13"
cc: "clang"
codegen: "amd64"
- runner: "macos-13"
cc: "clang"
codegen: "c"
- runner: "macos-13"
cc: "clang"
codegen: "llvm"
- runner: "macos-14"
cc: "clang"
codegen: "c"
- runner: "macos-14"
cc: "clang"
codegen: "llvm"
- runner: windows-2022
msystem: mingw64
cc: "gcc"
codegen: "amd64"
- runner: windows-2022
msystem: mingw64
cc: "gcc"
codegen: "c"
- runner: windows-2022
msystem: ucrt64
cc: "gcc"
codegen: "amd64"
- runner: windows-2022
msystem: ucrt64
cc: "gcc"
codegen: "c"
- runner: windows-2022
msystem: clang64
cc: "clang"
codegen: "amd64"
- runner: windows-2022
msystem: clang64
cc: "clang"
codegen: "c"
- runner: windows-2022
msystem: clang64
cc: "clang"
codegen: "llvm"
runs-on: ${{ matrix.runner }}
defaults:
run:
shell: ${{ (startsWith(matrix.runner, 'windows') && 'msys2 {0}') || 'bash' }}
steps:
- name: Configure git
shell: bash
run: git config --global core.autocrlf false
- name: Install msys2 (windows)
if: ${{ startsWith(matrix.runner, 'windows') }}
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
update: false
install: >-
base-devel
git
pactoys
- name: Checkout
uses: actions/checkout@v4
- name: Install bootstrap dependencies
uses: ./.github/actions/install-bootstrap-dependencies
with:
runner: ${{ matrix.runner }}
install-llvm: ${{ matrix.codegen == 'llvm' }}
- name: Check versions
run: |
PATH=$(pwd)/boot/bin:$PATH mlton
echo
make -version
echo
${{ matrix.cc }} --version
echo
if [[ "${{ matrix.codegen }}" == "llvm" ]]; then llvm-as -version; opt -version; llc -version; fi
- name: Build
run: |
# make all
PATH=$(pwd)/boot/bin:$PATH \
make \
CC=${{ matrix.cc }} \
OLD_MLTON_RUNTIME_ARGS="ram-slop 0.90" \
MLTON_RUNTIME_ARGS="ram-slop 0.90" \
MLTON_COMPILE_ARGS="-codegen ${{ matrix.codegen }}" \
$( if [[ -n "$WITH_GMP_DIR" ]]; then echo "WITH_GMP_DIR=$WITH_GMP_DIR"; fi ) \
WITH_ALL_RUNTIME=true \
WITH_DBG_RUNTIME=false \
MLTON_BINARY_RELEASE_SUFFIX=".${{ matrix.runner }}_${{ matrix.cc }}_${{ matrix.codegen }}" \
all
- name: Test
run: ./bin/regression -codegen ${{ matrix.codegen }}
- name: Status
run: |
git status
- name: Package
run: |
# make binary-release
make \
CC=${{ matrix.cc }} \
OLD_MLTON_RUNTIME_ARGS="ram-slop 0.90" \
MLTON_RUNTIME_ARGS="ram-slop 0.90" \
MLTON_COMPILE_ARGS="-codegen ${{ matrix.codegen }}" \
$( if [[ -n "$WITH_GMP_DIR" ]]; then echo "WITH_GMP_DIR=$WITH_GMP_DIR"; fi ) \
WITH_ALL_RUNTIME=true \
WITH_DBG_RUNTIME=false \
MLTON_BINARY_RELEASE_SUFFIX=".${{ matrix.runner }}${{ matrix.msystem && format('_msys2_{0}', matrix.msystem) || "" }}_${{ matrix.cc }}_${{ matrix.codegen }}" \
binary-release
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: mlton..${{ matrix.runner }}${{ matrix.msystem && format('_msys2_{0}', matrix.msystem) || "" }}_${{ matrix.cc }}_${{ matrix.codegen }}
path: ./*.tgz