-
Notifications
You must be signed in to change notification settings - Fork 17
85 lines (82 loc) · 2.67 KB
/
compile.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Compile & test
# Run whenever we push to any branch without a "/", other than [coverity-scan].
on:
push:
branches:
- '*'
- '!coverity-scan'
env:
# Shared variables amongst all projects / platforms / compilers.
CFLAGS_ALL: -std=c99 -O2
CFLAGS_CLANG_LIBCPERCIVA: -Wall -Wextra -Werror -Weverything
-Wno-#warnings -Wno-pedantic -Wno-padded
-Wno-format-nonliteral
-Wno-disabled-macro-expansion
-Wno-missing-noreturn
-Wno-unused-macros
-Wno-documentation-unknown-command
CFLAGS_GCC_LIBCPERCIVA: -Wall -Wextra -Werror -Wpedantic
-pedantic-errors -Wno-clobbered
# Variables for specific projects / platforms / compilers.
CFLAGS_CLANG_PROJECT: -Wno-thread-safety-analysis
-Wno-implicit-fallthrough -Wno-documentation
CFLAGS_GCC_PROJECT: -Wno-float-equal -Wno-alloc-zero -Wno-format-overflow
-Wno-jump-misses-init
CFLAGS_OSX: -Wno-poison-system-directories
-I/usr/local/opt/[email protected]/include
-Wno-reserved-id-macro
LDFLAGS_OSX: -L/usr/local/opt/[email protected]/lib
jobs:
Ubuntu:
name: Ubuntu
runs-on: ubuntu-20.04
steps:
- name: Update apt-get
run: sudo apt-get update
- name: Install software
run: sudo apt-get install --no-install-recommends valgrind
- name: Checkout code
uses: actions/checkout@v3
- name: Compile with clang
env:
CC: clang-10
CFLAGS: ${{ env.CFLAGS_ALL }}
${{ env.CFLAGS_CLANG_LIBCPERCIVA }}
${{ env.CFLAGS_CLANG_PROJECT }}
run: make
- name: Test clang binaries
env:
USE_VALGRIND: 1
run: make test
- name: Clean
run: make clean
- name: Compile with gcc
env:
CC: gcc-10
CFLAGS: ${{ env.CFLAGS_ALL }}
${{ env.CFLAGS_GCC_LIBCPERCIVA }}
${{ env.CFLAGS_GCC_PROJECT }}
run: make
- name: Test gcc binaries
env:
USE_VALGRIND: 1
run: make test
- name: Check for untracked files
run: test -z "$(git status --porcelain=v1)"
macOS:
name: macOS
runs-on: macOS-11
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Compile with clang
env:
CC: clang
CFLAGS: ${{ env.CFLAGS_ALL }}
${{ env.CFLAGS_CLANG_LIBCPERCIVA }}
${{ env.CFLAGS_CLANG_PROJECT }}
${{ env.CFLAGS_OSX }}
LDADD_EXTRA: ${{ env.LDFLAGS_OSX }}
run: make
- name: Test clang binaries
run: make test