Skip to content

Commit

Permalink
💚 fix use of setup-dotnet github action
Browse files Browse the repository at this point in the history
  • Loading branch information
Odonno committed Jan 18, 2025
1 parent b4de056 commit 2d1d404
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 102 deletions.
203 changes: 102 additions & 101 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Main Workflow

on:
push:
branches:
- main
# branches:
# - main
paths-ignore:
- '**.md'
pull_request:
Expand All @@ -13,17 +13,18 @@ on:
- '**.md'
jobs:
build:
needs: [embedded-build]
runs-on: ubuntu-4cores
# needs: [embedded-build]
## runs-on: ubuntu-4cores
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download embedded artifacts
uses: actions/download-artifact@v4
with:
name: embedded
path: ./rust-embedded/target/debug
# - name: Download embedded artifacts
# uses: actions/download-artifact@v4
# with:
# name: embedded
# path: ./rust-embedded/target/debug

- name: Setup dotnet 9.0
uses: actions/setup-dotnet@v4
Expand All @@ -39,102 +40,102 @@ jobs:
- name: Install dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore

test:
needs: [embedded-build]
runs-on: ubuntu-4cores
strategy:
matrix:
surrealdb_version: ["v1.5.5", "v2.0.4", "v2.1.2"]
steps:
- name: Checkout
uses: actions/checkout@v4
# - name: Build
# run: dotnet build --no-restore

# test:
# needs: [embedded-build]
# runs-on: ubuntu-4cores
# strategy:
# matrix:
# surrealdb_version: ["v1.5.5", "v2.0.4", "v2.1.2"]
# steps:
# - name: Checkout
# uses: actions/checkout@v4

- 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 ${{ matrix.surrealdb_version }}

- name: Run SurrealDB root
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 9.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: "9.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
- name: Upload Coverage
if: matrix.surrealdb_version == 'v2.1.2'
uses: codecov/codecov-action@v5
with:
directory: .coverage

embedded-build:
runs-on: ubuntu-4cores
steps:
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: |
rust-embedded
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
# - 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 ${{ matrix.surrealdb_version }}

# - name: Run SurrealDB root
# 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 9.0
# uses: actions/setup-dotnet@v4
# with:
# dotnet-version: "9.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

# - name: Upload Coverage
# if: matrix.surrealdb_version == 'v2.1.2'
# uses: codecov/codecov-action@v5
# with:
# directory: .coverage

# embedded-build:
# runs-on: ubuntu-4cores
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# sparse-checkout: |
# rust-embedded

# - name: Install stable toolchain
# uses: dtolnay/rust-toolchain@stable

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
# - name: Cache Rust dependencies
# uses: Swatinem/rust-cache@v2

- name: Build libraries
working-directory: ./rust-embedded
run: cargo build
# - name: Build libraries
# working-directory: ./rust-embedded
# run: cargo build

- name: Publish embedded artifacts
uses: actions/upload-artifact@v4
with:
name: embedded
path: |
./rust-embedded/target/debug/libsurreal_memory.so
./rust-embedded/target/debug/libsurreal_rocksdb.so
./rust-embedded/target/debug/libsurreal_surrealkv.so
# - name: Publish embedded artifacts
# uses: actions/upload-artifact@v4
# with:
# name: embedded
# path: |
# ./rust-embedded/target/debug/libsurreal_memory.so
# ./rust-embedded/target/debug/libsurreal_rocksdb.so
# ./rust-embedded/target/debug/libsurreal_surrealkv.so

cargo-check:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "9.0.100",
"version": "9.0.102",
"rollForward": "latestFeature"
}
}

0 comments on commit 2d1d404

Please sign in to comment.