Add actions. #1
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: C CI | |
on: | |
pull_request: | |
workflow_dispatch: | |
push: | |
branches-ignore: | |
- '_**' | |
- '**wip**' | |
jobs: | |
build: | |
if: ${{ ! startsWith(github.event.head_commit.message, 'WIP') }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, macos-latest ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- if: runner.os == 'Linux' | |
run: | | |
sudo apt install --no-install-recommends libcriterion-dev | |
- if: runner.os == 'macOS' | |
run: | | |
brew install criterion | |
echo CPATH="/opt/homebrew/include:$CPATH" >> "$GITHUB_ENV" | |
echo LIBRARY_PATH="/opt/homebrew/lib:$LIBRARY_PATH" >> "$GITHUB_ENV" | |
- name: Test | |
run: make -j2 test | |
- name: Test -O3 | |
run: make clean && make -j2 test XCFLAGS=-O3 | |
- name: Clang - Test | |
run: make clean && make -j2 test CC=clang | |
- name: Clang - Test -O3 | |
run: make clean && make -j2 test CC=clang XCFLAGS=-O3 |