From f844555afd0c6d970fbe2286a24559f75b0eafc2 Mon Sep 17 00:00:00 2001 From: Alan Garny Date: Wed, 16 Oct 2024 09:46:14 +1300 Subject: [PATCH] CI: added some "basic" GitHub Actions. --- .github/workflows/ci.yml | 71 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..8fe4048ccc --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,71 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + cpp: + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - name: 'Windows static library' + os: windows-latest + build_shared: OFF + - name: 'Windows shared library' + os: windows-latest + build_shared: ON + - name: 'Linux static library' + os: ubuntu-latest + build_shared: OFF + - name: 'Linux shared library' + os: ubuntu-latest + build_shared: ON + - name: 'macOS static library (Intel)' + os: macos-13 + build_shared: OFF + - name: 'macOS shared library (Intel)' + os: macos-13 + build_shared: ON + - name: 'macOS static library (ARM)' + os: macos-latest + build_shared: OFF + - name: 'macOS shared library (ARM)' + os: macos-latest + build_shared: ON + env: + BUILDCACHE_ACCURACY: STRICT + BUILDCACHE_COMPRESS_FORMAT: ZSTD + BUILDCACHE_DEBUG: -1 + BUILDCACHE_LOG_FILE: "" + steps: + - name: Check out libCellML + uses: actions/checkout@v4 + - name: Install CMake and Ninja + uses: lukka/get-cmake@latest + - name: Install buildcache + uses: mikehardy/buildcache-action@v2 + with: + cache_key: ${{ matrix.os }}-${{ matrix.build_shared }} + - name: Configure MSVC + if: ${{ runner.os == 'Windows' }} + uses: ilammy/msvc-dev-cmd@v1 + - name: Configure libCellML + run: | + mkdir build + cd build + cmake -G Ninja -DBUILD_SHARED=${{ matrix.build_shared }} .. + - name: Build libCellML + run: | + cd build + ninja + - name: Unit testing + run: | + cd build + ninja test