-
Notifications
You must be signed in to change notification settings - Fork 127
144 lines (126 loc) · 5.53 KB
/
build-and-test.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
name: Build & run tests
on:
- push
- pull_request
jobs:
build:
runs-on: ${{ matrix.os }}
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
- macos-10.15 # catalina
- macos-11.0 # big sur
- windows-2016
- windows-2019
config:
- Release
# If you add Debug, be careful about the LLVM build.
# LLVM Debug builds take a really long time, and consume a lot of disk space.
include:
- os: windows-2016
cmake-generator: -G "Visual Studio 15 2017" -A x64
- os: windows-2019
cmake-generator: -G "Visual Studio 16 2019" -A x64
steps:
- if: contains(matrix.os, 'ubuntu')
name: deps
run: |
sudo apt update
sudo apt-get install libasound2-dev xorg-dev libglu1-mesa-dev
- name: cache llvm
id: llvm-cache
uses: actions/cache@v2
with:
path: |
./llvm-3.8.0.install
key: ${{ matrix.os }}-${{ matrix.config }}-llvm.3.8.0-0 # bump this number if you want to trigger an LLVM build
- name: download and unpack llvm (macos/linux)
if: steps.llvm-cache.outputs.cache-hit != 'true' && !contains(matrix.os, 'windows')
run: |
wget "http://extempore.moso.com.au/extras/llvm-3.8.0.src-patched-for-extempore.tar.xz"
cmake -E tar xJf llvm-3.8.0.src-patched-for-extempore.tar.xz
- name: download and unpack llvm (windows)
if: contains(matrix.os, 'windows') && steps.llvm-cache.outputs.cache-hit != 'true'
run: |
Invoke-webrequest -Uri "http://extempore.moso.com.au/extras/llvm-3.8.0.src-patched-for-extempore.tar.xz" -OutFile "llvm-3.8.0.src-patched-for-extempore.tar.xz"
cmake -E tar xJf llvm-3.8.0.src-patched-for-extempore.tar.xz
- name: configure llvm
if: steps.llvm-cache.outputs.cache-hit != 'true'
run: |
mkdir llvm-3.8.0.build
mkdir llvm-3.8.0.install
cd llvm-3.8.0.build
cmake -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DLLVM_ENABLE_TERMINFO=OFF -DLLVM_ENABLE_ZLIB=OFF -DLLVM_INCLUDE_UTILS=OFF -DLLVM_BUILD_RUNTIME=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_GO_TESTS=OFF -DLLVM_INCLUDE_DOCS=OFF -DCMAKE_C_FLAGS="" -DCMAKE_CXX_FLAGS="" -DCMAKE_INSTALL_PREFIX=../llvm-3.8.0.install ${{ matrix.cmake-generator }} ../llvm-3.8.0.src/
- name: build llvm
if: steps.llvm-cache.outputs.cache-hit != 'true'
run: |
cd llvm-3.8.0.build
# if you're doing this by hand you might need `-- -j2` instead of `-j2`
cmake --build . --config ${{ matrix.config }} -j2
cmake --build . --config ${{ matrix.config }} -j2 --target llvm-as
- name: install llvm (macos/linux)
if: steps.llvm-cache.outputs.cache-hit != 'true' && !contains(matrix.os, 'windows')
run: |
cd llvm-3.8.0.build
cmake --install .
cp bin/llvm-as $GITHUB_WORKSPACE/llvm-3.8.0.install/bin/
- name: install llvm (windows)
if: contains(matrix.os, 'windows') && steps.llvm-cache.outputs.cache-hit != 'true'
run: |
cd llvm-3.8.0.build
cmake --install . --prefix ../llvm-3.8.0.install
cp .\${{ matrix.config }}\bin\llvm-as.exe ../llvm-3.8.0.install/bin/
- uses: actions/checkout@v2
with:
path: extempore
# I have no idea why `env:` seems to work for building, but not configuring :(
- name: configure extempore (macos/linux)
if: ${{ !contains(matrix.os, 'windows') }}
run: |
cd extempore
mkdir build
cd build
env EXT_LLVM_DIR=$GITHUB_WORKSPACE/llvm-3.8.0.install cmake -DASSETS=ON ${{ matrix.cmake-generator }} ..
- name: configure extempore (windows)
if: contains(matrix.os, 'windows')
run: |
$Env:EXT_LLVM_DIR="$Env:GITHUB_WORKSPACE/llvm-3.8.0.install"
cd extempore
mkdir build
cd build
cmake -DASSETS=ON ${{ matrix.cmake-generator }} ..
- name: build extempore (macos/linux)
if: ${{ !contains(matrix.os, 'windows') }}
env:
EXT_LLVM_DIR: "${{ env.GITHUB_WORKSPACE }}/llvm-3.8.0.install"
run: |
cd extempore/build
cmake --build . -j2 --config ${{ matrix.config }} --target extempore
- name: build extempore (windows)
if: contains(matrix.os, 'windows')
env:
EXT_LLVM_DIR: "${{ env.GITHUB_WORKSPACE }}/llvm-3.8.0.install/${{ matrix.config }}"
run: |
cd extempore/build
cmake --build . -j2 --config ${{ matrix.config }} --target extempore
- name: aot-compile-stdlib (macos/linux)
if: ${{ !contains(matrix.os, 'windows') }}
env:
EXT_LLVM_DIR: "${{ env.GITHUB_WORKSPACE }}/llvm-3.8.0.install"
run: |
cd extempore/build
cmake --build . -j2 --config ${{ matrix.config }}
- name: aot-compile-stdlib (windows)
if: ${{ contains(matrix.os, 'windows') }}
env:
EXT_LLVM_DIR: "${{ env.GITHUB_WORKSPACE }}/llvm-3.8.0.install/${{ matrix.config }}"
run: |
cd extempore/build
# -j1 due to intermittent flakiness when building AOT in parallel on Windows
cmake --build . -j1 --config ${{ matrix.config }}
- name: test
run: cd extempore && cd build && ctest --build-config ${{ matrix.config }} --label-regex libs-core