wip #165
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: Test | |
on: | |
push: | |
pull_request: | |
jobs: | |
build: | |
strategy: | |
matrix: | |
build-type: [Debug, RelWithDebInfo] | |
os: [ubuntu-latest, macos-latest] | |
asan-args: ["", "-fsanitize=address"] | |
std: ["c11", "c17"] | |
compiler: ["/usr/bin/clang", "/usr/bin/gcc", "/usr/local/bin/gcc-11", "/usr/local/bin/gcc-12"] | |
exclude: | |
- os: macos-latest | |
compiler: /usr/bin/gcc | |
- os: ubuntu-latest | |
compiler: /usr/local/bin/gcc-11 | |
- os: ubuntu-latest | |
compiler: /usr/local/bin/gcc-12 | |
fail-fast: false | |
runs-on: ${{matrix.os}} | |
steps: | |
- name: Install Deps using Apt | |
if: contains(matrix.os, 'ubuntu') | |
run: sudo apt-get update && sudo apt-get install -y llvm-15-dev | |
- name: Install Deps using Homebrew | |
if: contains(matrix.os, 'macos') | |
run: brew install bison llvm | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- name: Configure CMake | |
shell: bash | |
run: | | |
if [[ "${{matrix.os}}" == "macos"* ]]; then | |
cmake -B '${{github.workspace}}/build' -DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison -DLLVM_DIR="$(/usr/local/opt/llvm/bin/llvm-config --cmakedir)" -DCMAKE_BUILD_TYPE="${{matrix.build-type}}" -DCMAKE_C_COMPILER=${{matrix.compiler}} -DCMAKE_C_FLAGS="-Wpedantic -Wall -Werror -std=${{matrix.std}} ${{matrix.asan-args}}" | |
else | |
cmake -B '${{github.workspace}}/build' -DLLVM_DIR="$(llvm-config-15 --cmakedir)" -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DCMAKE_C_COMPILER="${{matrix.compiler}}" -DCMAKE_C_FLAGS="-Wpedantic -Wall -Werror -std=${{matrix.std}} ${{matrix.asan-args}}" | |
fi | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build-type}} | |
- name: Run | |
shell: bash | |
run: cat ${{github.workspace}}/tests/test.ptl | ${{github.workspace}}/build/ptlang | |