From 48e2fe8438b2c934c1cc42bde30636f00ffdf46b Mon Sep 17 00:00:00 2001 From: black-desk Date: Sat, 23 Mar 2024 15:03:43 +0800 Subject: [PATCH] ci: update github action --- .github/workflows/checks.yaml | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 1966490..9d8842a 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -18,45 +18,33 @@ jobs: runs-on: "ubuntu-latest" strategy: matrix: - type: [Debug, Release] - dependency: [Vendor, Online] + container: + - debian:stable-slim + - debian:sid-slim + preset: [debug, ci, ci-with-spdlog] cxx: [g++, clang++] + container: + image: ${{ matrix.container }} steps: - name: Checkout project uses: actions/checkout@v4 with: fetch-depth: 0 - # - uses: hendrikmuhs/ccache-action@v1.2 - # with: - # key: ${{ matrix.cxx }}-${{ matrix.type }} - name: Cache CPM.cmake Source uses: actions/cache@v4 with: path: .cache/cpm/source - key: ${{ runner.os }}-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} + key: ${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} - name: Install system dependencies run: | - sudo apt update && - sudo apt install libsystemd-dev + apt update && + apt install libsystemd-dev libspdlog-dev nlohmann-json3-dev - name: Build project with cmake run: | mkdir -p .cache/cpm/source && export CXX="${{ matrix.cxx }}" && - export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" && - export CPM_DOWNLOAD_ALL="ON" && export CPM_SOURCE_CACHE="$PWD/.cache/cpm/source" && - export CFLAGS="$CFLAGS -Wall" && - export CFLAGS="$CFLAGS -Wextra" && - export CFLAGS="$CFLAGS -Wpedantic" && - export CFLAGS="$CFLAGS -Wno-extra-semi -Wno-unused-command-line-argument -Wno-gnu-zero-variadic-macro-arguments" && - export CFLAGS="$CFLAGS -fsanitize=address,undefined" && - export CXXFLAGS="$CFLAGS" && - cmake --preset ${{ matrix.dependency }}${{ matrix.type }} && - cmake --build --preset ${{ matrix.dependency }}${{ matrix.type }} -j - - name: Run tests - if: ${{ false }} # This project has no tests for now. - run: | - cmake --build build -t test -j + cmake --workflow --preset ${{ matrix.preset }} pass: name: Pass needs: [checks, build-and-test]