From b838244ab9a672e51818c5382dffac156236b0de Mon Sep 17 00:00:00 2001 From: 0xG0nz0 <8682922+0xg0nz0@users.noreply.github.com> Date: Sun, 31 Dec 2023 15:57:47 -0500 Subject: [PATCH] Set up GitHub Actions CI (#4) --- .devcontainer/devcontainer.json | 7 +++++- .github/workflows/ci.yml | 39 +++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index c953ca5..cda805d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -4,8 +4,13 @@ "dockerfile": "Dockerfile" }, "features": { + "ghcr.io/devcontainers/features/common-utils:2": {}, + "ghcr.io/devcontainers/features/docker-in-docker:2": {}, "ghcr.io/devcontainers/features/github-cli:1": {}, - "ghcr.io/devcontainers-contrib/features/act:1": {} + "ghcr.io/devcontainers/features/python:1": {}, + "ghcr.io/devcontainers/features/rust:1": {}, + "ghcr.io/devcontainers-contrib/features/act:1": {}, + "ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {} }, "customizations": { "vscode": { diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..484da9a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +name: ci + +env: + CTEST_NO_TESTS_ACTION: error + HOMEBREW_NO_INSTALL_CLEANUP: 1 + +on: + push: + paths: + - "**.c" + - "**.cc" + - "**.cpp" + - "**.h" + - "**/CMakeLists.txt" + - "**.cmake" + - ".github/workflows/ci.yml" + +jobs: + core: + strategy: + matrix: + os: [ubuntu-20.04, ubuntu-latest, macos-latest] + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + - name: Configure + uses: threeal/cmake-action@v1.3.0 + with: + generator: Ninja + c-compiler: clang + cxx-compiler: clang++ + - name: Build + run: cmake --build build + - name: Unit Tests + run: build/iggy_cpp_test + \ No newline at end of file