|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + test: |
| 7 | + runs-on: ubuntu-latest |
| 8 | + |
| 9 | + strategy: |
| 10 | + fail-fast: false |
| 11 | + matrix: |
| 12 | + container_image: ["fedora:latest", "ubuntu:latest"] |
| 13 | + compiler: [g++, clang++] |
| 14 | + optflag: ["-O0", "-O2"] |
| 15 | + memcheck: [off, asan, valgrind] |
| 16 | + container: |
| 17 | + image: ${{ matrix.container_image }} |
| 18 | + |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v1 |
| 21 | + - name: install dependencies |
| 22 | + if: ${{ matrix.container_image == 'fedora:latest' }} |
| 23 | + run: dnf -y install clang gcc-c++ valgrind libasan jq |
| 24 | + - name: install dependencies |
| 25 | + if: ${{ matrix.container_image == 'ubuntu:latest' }} |
| 26 | + run: | |
| 27 | + apt-get -y update |
| 28 | + apt-get -y install g++ valgrind bash clang jq libasan5 |
| 29 | + - name: build and test |
| 30 | + shell: bash |
| 31 | + run: | |
| 32 | + export CXX=${{ matrix.compiler }} |
| 33 | + export CXXFLAGS="-std=gnu++14 -pthread -lpthread ${{ matrix.optflag }} -Wall -Wextra" |
| 34 | + export TESTFLAG="" |
| 35 | + if [[ "${{ matrix.memcheck }}" = "asan" ]]; then |
| 36 | + export CXXFLAGS="${CXXFLAGS} -fsanitize=address,undefined -fno-omit-frame-pointer" |
| 37 | + if [[ "${{ matrix.compiler }}" = "g++" ]]; then |
| 38 | + export CXXFLAGS="${CXXFLAGS} -fno-sanitize-recover" |
| 39 | + else |
| 40 | + export CXXFLAGS="${CXXFLAGS} -fno-sanitize-recover=all" |
| 41 | + fi |
| 42 | + elif [[ "${{ matrix.memcheck }}" = "valgrind" ]]; then |
| 43 | + export TESTFLAG="--valgrind" |
| 44 | + fi |
| 45 | + ${{ matrix.compiler }} -o jtc $CXXFLAGS jtc.cpp |
| 46 | + python3 run_tests.py -v $TESTFLAG User\ Guide.md Walk-path\ tutorial.md README.md |
0 commit comments