From bd06dd0551b5bfa5e15949f9351cf5bd3f244923 Mon Sep 17 00:00:00 2001 From: Odonno Date: Sun, 24 Nov 2024 12:56:13 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20use=20matrix=20table=20to=20test?= =?UTF-8?q?=20against=20different=20surrealdb=20versions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 67 +++++++--------------------------------- 1 file changed, 12 insertions(+), 55 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 534b69a8..d2b9ae94 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,61 +42,12 @@ jobs: - name: Build run: dotnet build --no-restore - test-v1: - needs: [embedded-build] - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Download embedded artifacts - uses: actions/download-artifact@v4 - with: - name: embedded - path: ./rust-embedded/target/debug - - - name: Download SurrealDB - run: curl --proto '=https' --tlsv1.2 -sSf https://install.surrealdb.com | sh -s -- --version v1.5.5 - - - name: Run SurrealDB root - run: surreal start --user root --pass root memory --auth --allow-guests & - - - name: Setup dotnet 8.0 - uses: actions/setup-dotnet@v3 - with: - dotnet-version: "8.0.x" - - - name: Install dependencies - run: dotnet restore - - - name: Build - run: dotnet build --no-restore - - - name: Test library - run: > - dotnet test - ./SurrealDb.Net.Tests/SurrealDb.Net.Tests.csproj - --no-restore - --no-build - --collect "XPlat Code Coverage" - --results-directory .coverage - -- - DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover - - - name: Test Live Query feature - run: > - dotnet test - ./SurrealDb.Net.LiveQuery.Tests/SurrealDb.Net.LiveQuery.Tests.csproj - --no-restore - --no-build - --collect "XPlat Code Coverage" - --results-directory .coverage - -- - DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover - - test-v2: + test: needs: [embedded-build] runs-on: ubuntu-latest + strategy: + matrix: + surrealdb_version: ["v1.5.5", "v2.0.4", "v2.1.0"] steps: - name: Checkout uses: actions/checkout@v3 @@ -108,10 +59,15 @@ jobs: path: ./rust-embedded/target/debug - name: Download SurrealDB - run: curl --proto '=https' --tlsv1.2 -sSf https://install.surrealdb.com | sh -s + run: curl --proto '=https' --tlsv1.2 -sSf https://install.surrealdb.com | sh -s -- --version ${{ matrix.surrealdb_version }} - name: Run SurrealDB root - run: surreal start --user root --pass root memory --allow-guests & + run: | + if [ "${{ matrix.surrealdb_version }}" == "v1.5.5" ]; then + surreal start --user root --pass root memory --auth --allow-guests & + else + surreal start --user root --pass root memory --allow-guests & + fi - name: Setup dotnet 8.0 uses: actions/setup-dotnet@v3 @@ -147,6 +103,7 @@ jobs: DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover - name: Upload Coverage + if: matrix.surrealdb_version == 'v2.1.0' uses: codecov/codecov-action@v3 with: directory: .coverage