-
Notifications
You must be signed in to change notification settings - Fork 8
156 lines (137 loc) · 4.96 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
---
name: ci
# These checks only run on pull requests as they don't need to publish anything
# on push. See docker.yml for jobs that run on pushes.
on:
pull_request:
branches: [master]
# Cancel old PR builds when pushing new commits.
concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
common:
uses: TokTok/ci-tools/.github/workflows/common-ci.yml@master
hie-bios:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: "Generate HIE BIOS output and haskell_targets.bzl"
run: tools/haskell/hie-docker
- name: "Verify that haskell_targets.bzl didn't change"
run: git diff --exit-code
docker-haskell:
runs-on: ubuntu-22.04
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build toxchat/toktok-stack:haskell
uses: docker/build-push-action@v5
with:
file: tools/built/src/Dockerfile.haskell
tags: toxchat/toktok-stack:haskell
cache-from: type=registry,ref=toxchat/toktok-stack:haskell
docker-test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build toxchat/toktok-stack:latest-third_party
run: docker compose build third_party
- name: Build toxchat/toktok-stack:latest
run: docker compose build latest
- name: Set up environment
run: |
echo "GROUP_ID=$(id -g)" >.env
echo "USER_ID=$(id -u)" >>.env
- name: Build for msan
run: |
tar -C .. -xf <(curl -L https://github.com/TokTok/toktok-stack/releases/download/nightly/msan.tar)
docker compose run --rm msan
docker kill bazel-cache
rm -rf ../bazel-cache
- name: Build for asan
run: |
tar -C .. -xf <(curl -L https://github.com/TokTok/toktok-stack/releases/download/nightly/asan.tar)
docker compose run --rm asan
docker kill bazel-cache
rm -rf ../bazel-cache
- name: Build for release
run: |
tar -C .. -xf <(curl -L https://github.com/TokTok/toktok-stack/releases/download/nightly/release.tar)
docker compose run --rm release
docker kill bazel-cache
rm -rf ../bazel-cache
- name: Build for arm64
run: |
tar -C .. -xf <(curl -L https://github.com/TokTok/toktok-stack/releases/download/nightly/arm64.tar)
docker compose run --rm arm64
docker kill bazel-cache
rm -rf ../bazel-cache
- name: Build for windows
run: |
tar -C .. -xf <(curl -L https://github.com/TokTok/toktok-stack/releases/download/nightly/windows.tar)
docker compose run --rm windows
docker kill bazel-cache
rm -rf ../bazel-cache
- name: Build for fastbuild
run: |
tar -C .. -xf <(curl -L https://github.com/TokTok/toktok-stack/releases/download/nightly/fastbuild.tar)
docker compose run --rm fastbuild
docker kill bazel-cache
rm -rf ../bazel-cache
- name: Build toxchat/toktok-stack:latest-dev
run: docker build -t toxchat/toktok-stack:latest-dev -f tools/built/src/Dockerfile.dev .
local-build:
runs-on: ubuntu-24.04
env:
CC: clang
CXX: clang++
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Download bazelisk
run: |
curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.25.0/bazelisk-amd64.deb -o bazelisk-amd64.deb
sudo apt-get install ./bazelisk-amd64.deb
- name: Install nix
run: |
curl -L https://nixos.org/nix/install -o install.sh
sh install.sh --no-channel-add --yes
rm install.sh
. "$HOME/.nix-profile/etc/profile.d/nix.sh"
nix-channel --add https://github.com/NixOS/nixpkgs/archive/a81bbdfb658428a45c69a42aa73d4bd18127c467.tar.gz nixpkgs
nix-channel --update
- name: Install mold
run: sudo apt-get install mold
- name: Build
run: |
. /home/runner/.nix-profile/etc/profile.d/nix.sh
nix-shell -p patchelf --run "patchelf --version"
bazel test --config=ci --config=local --config=remote -- //... -//jvm-toxcore-c/... -//third_party/...
macos:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Nix
run: sh <(curl -L https://nixos.org/nix/install) --yes
- name: Build
run: bazel test --config=remote //c-toxcore/toxcore/...
mypy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install mypy
run: pip install mypy
- name: Run mypy
run: make mypy