-
-
Notifications
You must be signed in to change notification settings - Fork 4
146 lines (139 loc) · 4.55 KB
/
workflow.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
name: Build
on:
push: {}
workflow_dispatch: {}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BAZELISK_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
defaults:
run:
shell: bash
jobs:
bazel-sync:
runs-on: ubuntu-latest
steps:
- uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: actions/checkout@v4
- run: DOCKER_BUILDKIT=1 docker build -o=. --target=sync . --progress=plain
- run: git --no-pager diff --exit-code
continue-on-error: true
build_on_ubuntu_with_gcc:
name: on ubuntu with GCC
runs-on: ubuntu-latest
steps:
- uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: actions/checkout@v4
- run: DOCKER_BUILDKIT=1 docker build -o=./bin/ --target=voidstar . --progress=plain
- run: ./bin/voidstar --help
- uses: actions/upload-artifact@v4
with:
name: voidstar_gcc_ubuntu
path: ./bin/voidstar
- run: DOCKER_BUILDKIT=1 docker build -o=. --target=video-gcc . --progress=plain
- run: mv ./bin/voidstar voidstar_gcc_ubuntu
- run: mv ./video.mp4 video_gcc_ubuntu.mp4
- uses: actions/upload-artifact@v4
with:
name: video-gcc_ubuntu
path: ./video_gcc_ubuntu.mp4
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
voidstar_gcc_ubuntu
video_gcc_ubuntu.mp4
build_on_ubuntu_with_clang:
name: on ubuntu with Clang
runs-on: ubuntu-latest
steps:
- uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: actions/checkout@v4
- run: DOCKER_BUILDKIT=1 docker build -o=./bin/ --target=voidstar-clang . --progress=plain
- run: ./bin/voidstar --help
- uses: actions/upload-artifact@v4
with:
name: voidstar_clang_ubuntu
path: ./bin/voidstar
- run: DOCKER_BUILDKIT=1 docker build -o=. --target=video-clang . --progress=plain
- run: mv ./bin/voidstar voidstar_clang_ubuntu
- run: mv ./video.mp4 video_clang_ubuntu.mp4
- uses: actions/upload-artifact@v4
with:
name: video-clang_ubuntu
path: ./video_clang_ubuntu.mp4
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
voidstar_clang_ubuntu
video_clang_ubuntu.mp4
build_on_macos:
name: on macos
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.cache/bazel
key: bazel
- name: Work around caching gobbledegook
run: |
if [[ -d ~/.cache/bazel ]]; then
chmod -R a+rwx ~/.cache/bazel
fi
- run: bazel build voidstar
- run: cp ./bazel-bin/voidstar/voidstar voidstar_clang_macos
- run: |
chmod +w voidstar_clang_macos
strip voidstar_clang_macos
- run: ./voidstar_clang_macos --help
- uses: actions/upload-artifact@v4
with:
name: voidstar_macos-latest
path: voidstar_clang_macos
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: voidstar_clang_macos
build_on_windows:
name: on windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: bazelbuild/setup-bazelisk@v1
- uses: actions/cache@v4
with:
path: ~/.cache/bazel
key: bazel
- name: Work around caching gobbledegook
run: |
if [[ -d ~/.cache/bazel ]]; then
chmod -R a+rwx ~/.cache/bazel
fi
- name: Work around windows compiler # TODO: a specific bazel --config
run: |
grep -vE 'fdiagnostics-color|std=c' .bazelrc >.bazelrc~ && mv .bazelrc~ .bazelrc
echo "build --cxxopt='-std:c++17'" >>.bazelrc
echo 'COPTS = []' >variables.bzl
- run: bazel build voidstar || true # TODO
# - run: ls -lha ./bazel-bin/voidstar/
# - run: strip ./bazel-bin/voidstar/voidstar.exe
# - run: ./bazel-bin/voidstar/voidstar.exe --help
# - uses: actions/upload-artifact@v4
# with:
# name: voidstar_windows-latest
# path: ./bazel-bin/voidstar/voidstar.exe
# - run: mv ./bazel-bin/voidstar/voidstar.exe voidstar_clang_windows.exe
# - uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
# with:
# files: voidstar_clang_windows.exe