Repository navigation
86 lines (76 loc) · 2.71 KB
/
Copy pathcompilation.yml
File metadata and controls
86 lines (76 loc) · 2.71 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
80
81
82
83
84
85
86
name: CI
on:
push:
pull_request:
repository_dispatch:
types: [run_build]
workflow_dispatch: {}
jobs:
ps2:
runs-on: ubuntu-latest
container: ps2dev/ps2sdk:latest
steps:
- uses: actions/checkout@v4
- name: Setup dependencies
run: |
apk update
apk add build-base make git cmake
- name: Compile OpenVCL and examples
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$PS2DEV" -DBUILD_EXAMPLES=ON
cmake --build build -j $(getconf _NPROCESSORS_ONLN)
- name: Run OpenVCL tests
run: |
ctest --test-dir build --output-on-failure
- name: Install OpenVCL
run: |
cmake --install build
- name: Get short SHA
id: slug
run: echo "sha8=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT
- name: Upload artifacts
if: ${{ success() }}
uses: actions/upload-artifact@v4
with:
name: openvcl-${{ steps.slug.outputs.sha8 }}
path: |
openvcl
examples/**/*.elf
sanitizers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Compile OpenVCL with ASan and UBSan
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DBUILD_EXAMPLES=OFF -DCMAKE_CXX_FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer"
cmake --build build -j $(getconf _NPROCESSORS_ONLN)
# Reports go to files, and any report fails the job: the integration tests
# run openvcl as a child process, and a test that expects it to fail would
# pass over a report on its stderr. openvcl does not free its register
# allocation data before it exits, so leaks are not checked. No test
# compiles the ps2gl programs in test/fixtures, so they are compiled here,
# all at once: with the sanitizers the slowest takes over a minute.
- name: Run OpenVCL tests and compile the fixtures
env:
ASAN_OPTIONS: detect_leaks=0:log_path=${{ runner.temp }}/sanitizers/report
UBSAN_OPTIONS: print_stacktrace=1:log_path=${{ runner.temp }}/sanitizers/report
run: |
mkdir -p "$RUNNER_TEMP/sanitizers"
status=0
ctest --test-dir build --output-on-failure || status=1
for fixture in test/fixtures/*.vcl; do
( ./openvcl -o "$RUNNER_TEMP/$(basename "$fixture").vsm" "$fixture" ||
echo "openvcl failed on $fixture" >> "$RUNNER_TEMP/failed" ) &
done
wait
if [ -f "$RUNNER_TEMP/failed" ]; then
cat "$RUNNER_TEMP/failed"
status=1
fi
for report in "$RUNNER_TEMP"/sanitizers/report.*; do
if [ -f "$report" ]; then
cat "$report"
status=1
fi
done
exit $status