From 40aaa59cece06272a357a4f3ca05e5dc8b4025a6 Mon Sep 17 00:00:00 2001 From: Matias Lindgren Date: Mon, 20 May 2024 15:48:33 +0200 Subject: [PATCH] run test in github actions on push to main --- .github/workflows/cpp.yaml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/cpp.yaml diff --git a/.github/workflows/cpp.yaml b/.github/workflows/cpp.yaml new file mode 100644 index 0000000..9478924 --- /dev/null +++ b/.github/workflows/cpp.yaml @@ -0,0 +1,36 @@ +name: build and test + +on: + push: + branches: main + paths: + - 'Makefile' + - '*.hpp' + - '*.cpp' + - '.github/workflows/cpp.yaml' + +jobs: + build-and-test: + timeout-minutes: 15 + runs-on: ubuntu-22.04 + steps: + - name: trust LLVM apt repositories + run: wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc + - name: add LLVM apt repositories + run: | + sudo add-apt-repository --yes "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" + sudo add-apt-repository --yes "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" + - name: install llvm + run: | + sudo apt update --yes + sudo apt install --yes \ + clang-18 \ + libc++-18-dev \ + libc++abi-18-dev \ + lld-18 + - name: checkout ndvec repo + uses: actions/checkout@v4 + - name: test + run: make CXX=clang-18 test && ./test + - name: main + run: make CXX=clang-18 main && ./main || [ "$?" -eq 50 ] || echo "expected main to exit with 50" && exit 1