Merge pull request #288 from Tarsnap/libcperciva-import #231
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |