From ccf635e4db70da0bfe96b8118a83eb092d443b62 Mon Sep 17 00:00:00 2001 From: Martin Evans Date: Sun, 30 Jul 2023 00:24:08 +0100 Subject: [PATCH] Added GH action for some simple CI --- .github/workflows/main.yml | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..f8204697 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,48 @@ +name: CI +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build: + name: Test + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + build: [linux-debug, linux-release, macos-debug, macos-release, windows-debug, windows-release] + include: + - build: linux-debug + os: ubuntu-latest + config: debug + - build: linux-release + os: ubuntu-latest + config: release + - build: macos-debug + os: macos-latest + config: debug + - build: macos-release + os: macos-latest + config: release + - build: windows-debug + os: windows-2019 + config: debug + - build: windows-release + os: windows-2019 + config: release + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: '7.0.x' + # workaround for actions/setup-dotnet#155 + - name: Clear package cache + run: dotnet clean LlamaSharp.sln && dotnet nuget locals all --clear + - name: Restore packages + run: dotnet restore LlamaSharp.sln + - name: Build + run: dotnet build LlamaSharp.sln -c ${{ matrix.config }} --no-restore + - name: Test + run: dotnet test LlamaSharp.sln -c ${{ matrix.config }}