-
Notifications
You must be signed in to change notification settings - Fork 43
104 lines (88 loc) · 2.9 KB
/
c-cpp.yml
File metadata and controls
104 lines (88 loc) · 2.9 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: C/C++ CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
strategy:
fail-fast: false
matrix:
config:
# Linux
- displayTargetName: 'Linux x86_64 (GCC)'
artifact: 'virtualjaguar_libretro.so'
os: ubuntu-latest
cc: 'gcc'
cxx: 'g++'
- displayTargetName: 'Linux x86_64 (Clang)'
artifact: 'virtualjaguar_libretro.so'
os: ubuntu-latest
cc: 'clang'
cxx: 'clang++'
- displayTargetName: 'Linux aarch64'
artifact: 'virtualjaguar_libretro.so'
os: ubuntu-24.04-arm
cc: 'gcc'
cxx: 'g++'
# macOS
- displayTargetName: 'macOS arm64 (Clang)'
artifact: 'virtualjaguar_libretro.dylib'
os: macos-latest
cc: 'clang'
cxx: 'clang++'
# Windows
- displayTargetName: 'Windows x86_64 (MSYS2)'
artifact: 'virtualjaguar_libretro.dll'
os: windows-latest
cc: 'gcc'
cxx: 'g++'
shell: 'msys2 {0}'
name: build-${{ matrix.config.displayTargetName }}
runs-on: ${{ matrix.config.os }}
defaults:
run:
shell: ${{ matrix.config.shell || 'bash' }}
steps:
- uses: actions/checkout@v4
- name: Set up MSYS2
if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: false
install: >-
mingw-w64-x86_64-gcc
make
- name: Build
run: make -j4 CC=${{ matrix.config.cc }} CXX=${{ matrix.config.cxx }}
- name: Run cheat engine unit tests
run: |
${{ matrix.config.cc }} -O2 -Wall -std=c99 \
-I src -I libretro-common/include \
-o test_cheat test/test_cheat.c src/cheat.c
./test_cheat
- name: Run SIMD blitter tests
run: |
# Detect which SIMD impl to test based on runner architecture
ARCH=$(uname -m)
case "$ARCH" in
x86_64|i686|i386) SIMD_SRC=src/blitter_simd_sse2.c; EXTRA="-msse2" ;;
aarch64|arm64) SIMD_SRC=src/blitter_simd_neon.c; EXTRA="" ;;
*) SIMD_SRC=src/blitter_simd_scalar.c; EXTRA="" ;;
esac
echo "==> Testing ${SIMD_SRC}..."
${{ matrix.config.cc }} -O2 -Wall ${EXTRA} -I src \
-o test_blitter_simd test/test_blitter_simd.c ${SIMD_SRC}
./test_blitter_simd
echo "==> Cross-checking against scalar..."
${{ matrix.config.cc }} -O2 -Wall -I src \
-o test_blitter_scalar test/test_blitter_simd.c src/blitter_simd_scalar.c
./test_blitter_scalar
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.displayTargetName }}
path: ${{ matrix.config.artifact }}
if-no-files-found: error