From db4ad5c4b3d78b592a446a1cea1b84dde8b169df Mon Sep 17 00:00:00 2001 From: Duncan Ogilvie Date: Wed, 2 Oct 2024 00:21:18 +0200 Subject: [PATCH] Add GitHub Actions --- .devcontainer/Dockerfile | 20 +++++--------------- .github/workflows/build.yml | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index f22c13d..24bca9b 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,15 +1,5 @@ -FROM ghcr.io/llvmparty/packages/ubuntu:22.04-llvm19.1.0 - -RUN apt update && apt install -y \ - git \ - clangd \ - clang-format \ - cmake \ - ninja-build \ - gdb \ - ninja-build \ - python3 \ - python3-pip \ - python3-venv \ - sudo \ - && rm -rf /var/lib/apt/lists/* \ No newline at end of file +FROM ghcr.io/llvmparty/packages/ubuntu:22.04-llvm19.1.0 + +RUN apt update && apt install -y --no-install-recommends \ + gdb \ + && rm -rf /var/lib/apt/lists/* diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1c445bb --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,20 @@ +name: build + +on: [push, pull_request] + +jobs: + cmake: + # Skip building pull requests from the same repository + if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }} + runs-on: ubuntu-22.04 + container: + image: ghcr.io/llvmparty/packages/ubuntu:22.04-llvm19.1.0 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build + shell: bash + run: | + cmake --preset clang + cmake --build build