From 7f00cf029b29cd7c90e6d42818525fd5efd01e2b Mon Sep 17 00:00:00 2001 From: sinofp Date: Sun, 7 Feb 2021 00:26:24 +0800 Subject: [PATCH] Add CTest in GitHub Action --- .github/workflows/ci.yml | 20 -------------------- .github/workflows/test.yml | 28 ++++++++++++++++++++++++++++ format.sh | 1 + 3 files changed, 29 insertions(+), 20 deletions(-) delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 920d12a..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: CI - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - runs-on: ubuntu-20.04 - strategy: - matrix: - cc: [ clang, gcc ] - steps: - - uses: actions/checkout@v2 - - name: Build - run: env CFLAGS="-Wpedantic -Wall -Werror" cmake -B build && make -C build - env: - CC: /usr/bin/${{ matrix.cc }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..2386d63 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,28 @@ +name: Test + +on: + push: + pull_request: + branches: [master] + +jobs: + build-test: + runs-on: ubuntu-20.04 + strategy: + matrix: + cc: [clang, gcc] + steps: + - uses: actions/checkout@v2 + - name: Build + run: cmake -B build && make -C build + env: + CC: /usr/bin/${{ matrix.cc }} + CFLAGS: "-Wpedantic -Wall -Werror" + run-test: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Build + run: cmake -B build && make -C build + - name: Test + run: cd build && ctest diff --git a/format.sh b/format.sh index 101c3d9..01f9cf8 100755 --- a/format.sh +++ b/format.sh @@ -3,3 +3,4 @@ clang-format -i {utility,espresso}/*.{h,c} cmake-format -i CMakeLists.txt shfmt -i 4 -w format.sh +prettier --write .github/workflows/*