From 387fc38ec411131e3309c932af0145e0f1b99048 Mon Sep 17 00:00:00 2001 From: Hudd Date: Sun, 9 Apr 2023 02:04:00 +0400 Subject: [PATCH] ci: Add github workflows Added a basic workflow with LLVM 18. 18 is the default for the ubuntu-latest (24.04) image. I wanted to directly use artifacts from the awlib repo instead of building it directly but it's better to have a working CI than chasing efficiency with broken CI. --- .github/workflows/cmake.yml | 62 +++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/cmake.yml diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml new file mode 100644 index 0000000..b9b99c5 --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,62 @@ +name: CMake + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +env: + BUILD_TYPE: Release + LLVM_DIR: /usr/lib/llvm-18/lib/cmake/llvm + +jobs: + build: + runs-on: ubuntu-24.04 + + steps: + - name: Checkout awlang + uses: actions/checkout@v4 + + - name: Checkout awlib + uses: actions/checkout@v4 + with: + repository: absurdworlds/awlib + path: awlib + + # LLVM is installed from apt instead of built from source: building + # LLVM itself takes far too long to be worth it in CI. + - name: Install LLVM + run: | + sudo apt-get update + sudo apt-get install -y llvm-18-dev libzstd-dev + + - name: Configure awlib + run: > + cmake -S awlib -B awlib/build + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + -DAW_MAKE_TESTS=OFF + -DAW_ENABLE_GRAPHICS=OFF + -DAW_ENABLE_LUA=OFF + + - name: Build awlib + run: cmake --build awlib/build --config ${{env.BUILD_TYPE}} + + - name: Install awlib + run: cmake --install awlib/build --prefix ${{github.workspace}}/awlib-install + + - name: Configure awlang + run: > + cmake -B ${{github.workspace}}/build + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + -DCMAKE_PREFIX_PATH=${{github.workspace}}/awlib-install + -DLLVM_DIR=${{env.LLVM_DIR}} + + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Test + working-directory: ${{github.workspace}}/build + # codegen/pointer.aw is a known-failing test (pointer-lvalue codegen bug, + # tracked separately) and is excluded so CI stays a signal for regressions. + run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure -E "codegen/pointer.aw"