Repository navigation
79 lines (64 loc) · 2.27 KB
/
Copy pathci.yml
File metadata and controls
79 lines (64 loc) · 2.27 KB
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
name: CI
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
native:
name: Bot build and native tests (g++)
runs-on: ubuntu-latest
timeout-minutes: 30
env:
CXX: g++
steps:
- uses: actions/checkout@v5
- name: Compiler version
run: $CXX --version
- name: Build bots/abyss natively
run: $CXX -std=c++20 -O2 -o "$RUNNER_TEMP/abyss_native" bots/abyss/main.cpp
- name: Native unit tests
# run.sh adds -include bits/stdc++.h itself when the compiler uses libstdc++ (see tests/README.md)
run: bash tests/native/run.sh
wasm:
name: Released bot's WASM hash (unswbc 1.2.9 --sandbox)
runs-on: ubuntu-latest
timeout-minutes: 20
env:
EXPECTED: 0f39d15f10a503b5d5602144660b8c3d3e62cae53ed1fa94e792c88e395e3b0e # pragma: allowlist secret
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install the toolkit
run: python -m pip install unswbc==1.2.9 wasmtime==49.0.0 # wasmtime: the version the release hash was verified with
- name: Build bots/abyss in the sandbox and compare the hash
# the first sandbox build also compiles the toolkit's clang for the runner (up to a minute)
working-directory: bots
run: |
unswbc maps maps
unswbc init cpp starter
cache="${XDG_CACHE_HOME:-$HOME/.cache}/unswbc/wasmbots"
if [ -d "$cache" ]; then find "$cache" -name 'abyss-*.wasm' -delete; fi
unswbc run maps/arena.map abyss starter --sandbox --no-replay --seed 1
got=$(sha256sum "$cache"/abyss-*.wasm | cut -d' ' -f1)
echo "abyss wasm sha256: $got"
test "$got" = "$EXPECTED"
python:
name: Tools and infra tests (Python)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install test dependencies
run: python -m pip install pytest pycapnp numpy scipy zstandard
- name: Tools tests
working-directory: tools
run: python -m pytest -q
- name: Infra tests
run: python -m pytest -q infra/tests