-
Notifications
You must be signed in to change notification settings - Fork 2
68 lines (65 loc) · 2.25 KB
/
run-tests.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
#
# CI for running tests
#
on:
push:
tags:
- 'Nightly'
name: Automated Tests
jobs:
run-tests-linux:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get -y update
sudo apt-get -ym install libbz2-dev zlib1g-dev libpng-dev autoconf clang-14 ccache moreutils
- name: Cache
uses: actions/cache@v4
with:
path: ~/.ccache
key: ccache:${{ github.job }}:${{ github.ref }}:${{ github.sha }}
restore-keys: |
ccache:${{ github.job }}:${{ github.ref }}
ccache:${{ github.job }}
- name: Configure Simutrans Build
run: |
autoconf
CC="ccache clang" CXX="ccache clang++" ./configure
echo "FLAGS += -Wno-cast-align" >> config.default
echo "FLAGS += -fsanitize=address,undefined -fno-sanitize-recover=all -fno-sanitize=shift,function" >> config.default
echo "LDFLAGS += -fsanitize=address,undefined" >> config.default
echo "STATIC := 0" >> config.default
- name: Build Simutrans
run: |
CC="ccache clang" CXX="ccache clang++" make -j$(nproc)
- name: Install pak64
run: |
pushd simutrans
chmod +755 ../tools/get_lang_files.sh
chmod +755 ../tools/get_pak.sh
printf '1\ni\ny\n' | ../tools/get_pak.sh
popd
- name: Install language files
run: |
chmod +755 tools/get_lang_files.sh
tools/get_lang_files.sh
- name: Link tests as scenario
run: |
mkdir -p ~/simutrans/addons/pak/scenario
ln -sT $GITHUB_WORKSPACE/tests ~/simutrans/addons/pak/scenario/automated-tests
- name: Create simuconf
run: |
mkdir -p ~/simutrans/
echo "frames_per_second = 100" >> ~/simutrans/simuconf.tab
echo "fast_forward_frames_per_second = 100" >> ~/simutrans/simuconf.tab
- name: Run tests
run: |
export ASAN_OPTIONS="print_stacktrace=1 abort_on_error=1 detect_leaks=0"
export UBSAN_OPTIONS="print_stacktrace=1 abort_on_error=1"
cp tools/run-automated-tests.sh .
chmod +x run-automated-tests.sh
ulimit -St 600 # 10 minutes ought to be enough for anybody.
./run-automated-tests.sh