From 8ae5748534dc653cb9fa1fa724578e86f0bebaed Mon Sep 17 00:00:00 2001 From: Jan Breuer <jan.breuer@jaybee.cz> Date: 周一, 16 1月 2023 23:28:17 +0800 Subject: [PATCH] action: add additional compiler configurations --- /dev/null | 53 ----------------- .github/workflows/main.yml | 97 ++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 53 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..5c49ed6 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,97 @@ +name: Build +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: install_dependencies + run: sudo apt-get install libcunit1-dev clang + + - name: make + run: make clean all test + + - name: clang_sanitize_address + env: + CC: clang + CFLAGS: -g -O0 -fsanitize=address + LDFLAGS: -g -fsanitize=address + run: make clean test + + - name: clang_sanitize_address_device_errors + env: + CC: clang + CFLAGS: -g -O0 -fsanitize=address -DUSE_DEVICE_DEPENDENT_ERROR_INFORMATION=0 + LDFLAGS: -g -fsanitize=address + run: make clean test + + - name: clang_sanitize_address_nomalloc + env: + CC: clang + CFLAGS: -g -O0 -fsanitize=address -DUSE_MEMORY_ALLOCATION_FREE=0 + LDFLAGS: -g -fsanitize=address + run: make clean test + +# - name: gcc-c89 +# env: +# CFLAGS: -std=c89 +# run: make clean all test + +# - name: gcc-c90 +# env: +# CFLAGS: -std=c90 +# run: make clean all test + + - name: gcc-c99 + env: + CFLAGS: -std=c99 + run: make clean all test + + - name: gcc-gnu99 + env: + CFLAGS: -std=gnu99 + run: make clean all test + + build-arm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: uraimo/run-on-arch-action@v2 + name: Run commands + id: runcmd + with: + arch: armv7 + distro: ubuntu_latest + install: | + apt-get update -q -y + apt-get install -q -y build-essential libcunit1-dev + run: make clean all test + + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: install_dependencies + run: sudo apt-get install libcunit1-dev lcov + + - name: coverage + env: + CFLAGS: -fprofile-arcs -ftest-coverage + LDFLAGS: -lgcov + run: make clean all test + + - name: lcov_capture + run: lcov --capture --directory libscpi/ --output-file lcov.info + + - name: lcov_cleanup + run: lcov --remove lcov.info '*/test/*' --output-file lcov.info + + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: ./lcov.info diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml deleted file mode 100644 index 0ddd13a..0000000 --- a/.github/workflows/ubuntu.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: ubuntu-latest -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: install_dependencies - run: sudo apt-get install libcunit1-dev clang lcov - - - name: make - run: make clean all - - - name: clang_sanitize_address - env: - CC: clang - CFLAGS: -g -O0 -fsanitize=address - LDFLAGS: -g -fsanitize=address - run: make clean test - - - name: clang_sanitize_address_device_errors - env: - CC: clang - CFLAGS: -g -O0 -fsanitize=address -DUSE_DEVICE_DEPENDENT_ERROR_INFORMATION=0 - LDFLAGS: -g -fsanitize=address - run: make clean test - - - name: clang_sanitize_address_nomalloc - env: - CC: clang - CFLAGS: -g -O0 -fsanitize=address -DUSE_MEMORY_ALLOCATION_FREE=0 - LDFLAGS: -g -fsanitize=address - run: make clean test - - - name: coverage - env: - CFLAGS: -fprofile-arcs -ftest-coverage - LDFLAGS: -lgcov - run: make clean all test - - - name: lcov_capture - run: lcov --capture --directory libscpi/ --output-file lcov.info - - - name: lcov_cleanup - run: lcov --remove lcov.info '*/test/*' --output-file lcov.info - - - name: Coveralls - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: ./lcov.info -- Gitblit v1.9.1