-
Notifications
You must be signed in to change notification settings - Fork 22
157 lines (143 loc) · 4.68 KB
/
build.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
name: Build
on: [push, pull_request]
jobs:
check-nix-flake:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
- name: Check Nix Flake
run: nix flake check --print-build-logs
check-nix-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
- name: Build package
run: nix build --print-build-logs
build-windows:
runs-on: windows-2022
defaults:
run:
shell: cmd
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: lukka/get-cmake@latest
- name: Build blisp tool
run: |
mkdir build
cd build
cmake .. -DBLISP_BUILD_CLI=ON -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: blips-windows-x86_64
path: |
build/tools/blisp/Release/blisp.exe
if-no-files-found: error
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: lukka/get-cmake@latest
- name: Build blisp tool
run: |
mkdir build
cd build
cmake .. -DBLISP_BUILD_CLI=ON -DCMAKE_BUILD_TYPE=Release
cmake --build .
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: blips-apple-universal
path: |
build/tools/blisp/blisp
if-no-files-found: error
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: lukka/get-cmake@latest
- name: Build blisp tool
run: |
mkdir build
cd build
cmake .. -DBLISP_BUILD_CLI=ON -DCMAKE_BUILD_TYPE=Release
cmake --build .
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: blips-linux-x86_64
path: |
build/tools/blisp/blisp
if-no-files-found: error
build-linux-alternative-arch:
runs-on: ubuntu-latest
name: Build on ${{ matrix.distro }} ${{ matrix.arch }}
# Run steps on a matrix of 4 arch/distro combinations
strategy:
matrix:
include:
- arch: aarch64
distro: ubuntu_latest
- arch: armv7
distro: ubuntu_latest
- arch: riscv64
distro: ubuntu_latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: uraimo/run-on-arch-action@v2
name: Build artifact
id: build
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}
# Create an artifacts directory
setup: |
mkdir -p "${PWD}/artifacts"
# Mount the artifacts directory as /artifacts in the container
dockerRunArgs: |
--volume "${PWD}/artifacts:/artifacts"
# Pass some environment variables to the container
env: | # YAML, but pipe character is necessary
artifact_name: blisp-linux-${{ matrix.arch }}
# The shell to run commands with in the container
shell: /bin/sh
# Install some dependencies in the container. This speeds up builds if
# you are also using githubToken. Any dependencies installed here will
# be part of the container image that gets cached, so subsequent
# builds don't have to re-install them. The image layer is cached
# publicly in your project's package repository, so it is vital that
# no secrets are present in the container state or logs.
install: |
case "${{ matrix.distro }}" in
ubuntu*|jessie|stretch|buster|bullseye)
apt-get update -q -y
apt-get install -q -y git cmake build-essential
;;
esac
# Produce a binary artifact and place it in the mounted volume
run: |
git config --global --add safe.directory /home/runner/work/blisp/blisp
mkdir build
cd build
cmake .. -DBLISP_BUILD_CLI=ON -DCMAKE_BUILD_TYPE=Release
cmake --build . -j2
cp ./tools/blisp/blisp "/artifacts/${artifact_name}"
echo "Produced artifact at /artifacts/${artifact_name}"
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: blisp-linux-${{ matrix.arch }}
path: |
artifacts/blisp-*
if-no-files-found: error