Skip to content

Add GitHub actions CI #6

Add GitHub actions CI

Add GitHub actions CI #6

Workflow file for this run

name: .NET
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
dotnet: [ '3.1.x', '5.0.x', '6.0.x', '8.0.x' ]
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
id: stepid
with:
dotnet-version: ${{ matrix.dotnet }}
# By default, tests will be executed under the latest installed version!
- name: Create temporary global.json
run: echo '{"sdk":{"version":"${{steps.stepid.outputs.dotnet-version}}"}}' > ./global.json
# - name: Restore nuget dependencies
# run: dotnet restore
# - name: Build solution
# run: dotnet build --no-restore
- name: Build solution
# Specify the path to the test project and not the solution because using --framework requires an
# exact string match in each csproj, but our library uses netstandard2.1 and not a specific netx.y
run: dotnet build --configuration Release --framework ${{ matrix.dotnet }} SqliteCache.Tests/SqliteCache.Tests.csproj
- name: Run tests
run: dotnet test --configuration Release --no-build --verbosity normal --framework ${{ matrix.dotnet }}