Skip to content

Commit ff26b7a

Browse files
committed
Add GitHub Actions CI workflow
1 parent 9d5696c commit ff26b7a

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
8+
jobs:
9+
linux:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
cc: [gcc, clang]
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Build and run smoke tests
18+
run: make CC=${{ matrix.cc }}
19+
20+
macos:
21+
runs-on: macos-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Build and run smoke tests
25+
run: make CC=clang
26+
27+
windows-msvc:
28+
runs-on: windows-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: ilammy/msvc-dev-cmd@v1
32+
- name: Build and run smoke tests
33+
shell: cmd
34+
run: |
35+
cl /W3 /O2 /Fe:smoke.exe smoke.c tinyexpr.c || exit /b 1
36+
smoke.exe || exit /b 1
37+
cl /W3 /O2 /DTE_POW_FROM_RIGHT /DTE_NAT_LOG /Fe:smoke_pr.exe smoke.c tinyexpr.c || exit /b 1
38+
smoke_pr.exe || exit /b 1
39+
40+
sanitizers:
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v4
44+
- name: Build and run smoke tests with ASan/UBSan
45+
run: |
46+
gcc -Wall -Wshadow -O1 -g -fsanitize=address,undefined -fno-sanitize-recover=all -o smoke_san smoke.c tinyexpr.c -lm
47+
./smoke_san
48+
gcc -Wall -Wshadow -O1 -g -fsanitize=address,undefined -fno-sanitize-recover=all -DTE_POW_FROM_RIGHT -DTE_NAT_LOG -o smoke_san_pr smoke.c tinyexpr.c -lm
49+
./smoke_san_pr

0 commit comments

Comments
 (0)