From 5330f9f72528d08b57048e12914bbe1e34686c91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20=22xq=22=20Quei=C3=9Fner?= Date: Sat, 1 Jul 2023 12:34:37 +0200 Subject: [PATCH] Adds GitHub CI --- .github/workflows/build.yaml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..c64caff --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,34 @@ +name: CMake + +on: + push: + branches: ['main'] + pull_request: + branches: ['main','format_tooling'] + +env: + CMAKE_GENERATOR: Ninja + +jobs: + build: + strategy: + matrix: + # Build with all four build types: + build_type: ["Debug", "Release", "RelWithDebInfo, "MinSizeRel"] + + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v3 + + - name: Fetch & install RISC-V GNU Compiler Toolchain + run: | + curl -Lo riscv32-elf-ubuntu-22.04-nightly.tar.gz 'https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2023.06.09/riscv32-elf-ubuntu-22.04-nightly-2023.06.09-nightly.tar.gz' + tar -xf riscv32-elf-ubuntu-22.04-nightly.tar.gz + echo "${PWD}/riscv/bin" >> $GITHUB_PATH + + - name: Configure CMake + run: cmake -B "${{github.workspace}}/build" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{ matrix.build_type }}