From: Stephen Seo Date: Wed, 18 Dec 2024 11:22:14 +0000 (+0900) Subject: Add Github workflow/action for unit tests X-Git-Tag: 1.9^2~8 X-Git-Url: https://git.seodisparate.com/stephenseo/annotated.html?a=commitdiff_plain;h=90377359d37a2e72ce48c0133ef7e407dfe31ee3;p=SimpleArchiver Add Github workflow/action for unit tests --- diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml new file mode 100644 index 0000000..f5420b6 --- /dev/null +++ b/.github/workflows/unittest.yml @@ -0,0 +1,24 @@ +name: Run Unit Tests +on: + push: + branches: + - '*' + +jobs: + build-and-run-unit-tests: + runs-on: ubuntu-latest + steps: + - name: Clone repo + run: git clone --depth=1 --no-single-branch https://github.com/Stephen-Seo/SimpleArchiver.git + - name: Checkout the branch + run: cd SimpleArchiver && git checkout "${GITHUB_REF_NAME}" + - name: Get cmake/gcc + run: sudo apt-get -y install cmake gcc sed + - name: Patch CMakeLists.txt to remove "-fstrict-flex-arrays=3" which is unavailable in ubuntu-latest + run: sed -i 's/-fstrict-flex-arrays=3//g' SimpleArchiver/CMakeLists.txt + - name: Prepare and Build + run: cmake -S SimpleArchiver -B build -DCMAKE_BUILD_TYPE=Debug && make -C build + - name: Run data structures unit tests + run: ./build/test_datastructures + - name: Run regular unit tests + run: ./build/test_simplearchiver