mirror of
https://github.com/S7NetPlus/s7netplus.git
synced 2026-02-17 22:38:27 +08:00
ci: Run tests against all target frameworks on all OS-es
This commit is contained in:
39
.github/workflows/dotnet.yml
vendored
39
.github/workflows/dotnet.yml
vendored
@@ -72,47 +72,20 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [windows-latest, ubuntu-20.04, macos-latest]
|
||||
test-framework: [net6.0, net7.0]
|
||||
include:
|
||||
- os: ubuntu-20.04
|
||||
test-framework: net6.0
|
||||
installSnap7: true
|
||||
dotnet-sdk: '6.x'
|
||||
- os: ubuntu-20.04
|
||||
test-framework: net7.0
|
||||
installSnap7: true
|
||||
dotnet-sdk: '7.x'
|
||||
- os: macos-latest
|
||||
test-framework: net6.0
|
||||
installSnap7: true
|
||||
dotnet-sdk: '6.x'
|
||||
- os: macos-latest
|
||||
test-framework: net7.0
|
||||
installSnap7: true
|
||||
dotnet-sdk: '7.x'
|
||||
- os: windows-latest
|
||||
test-framework: net6.0
|
||||
dotnet-sdk: '6.x'
|
||||
- os: windows-latest
|
||||
test-framework: net7.0
|
||||
dotnet-sdk: '7.x'
|
||||
- os: windows-latest
|
||||
test-framework: net462
|
||||
dotnet-sdk: '7.x'
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Install Snap7 Linux
|
||||
if: ${{ matrix.installSnap7 && matrix.os == 'ubuntu-20.04' }}
|
||||
if: ${{ matrix.os == 'ubuntu-20.04' }}
|
||||
run: |
|
||||
sudo add-apt-repository ppa:gijzelaar/snap7
|
||||
sudo apt-get update
|
||||
sudo apt-get install libsnap7-1 libsnap7-dev
|
||||
|
||||
- name: Install Snap7 MacOs
|
||||
if: ${{ matrix.installSnap7 && matrix.os == 'macos-latest' }}
|
||||
if: ${{ matrix.os == 'macos-latest' }}
|
||||
run: |
|
||||
brew install snap7
|
||||
|
||||
@@ -120,7 +93,7 @@ jobs:
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: |
|
||||
${{ matrix.dotnet-sdk }}
|
||||
6.x
|
||||
7.x
|
||||
|
||||
- name: Nuget Cache
|
||||
@@ -128,12 +101,12 @@ jobs:
|
||||
with:
|
||||
path: ~/.nuget/packages
|
||||
# Look to see if there is a cache hit for the corresponding requirements file
|
||||
key: ${{ runner.os }}-${{ matrix.test-framework }}-nuget-${{ hashFiles('**/packages.lock.json') }}
|
||||
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-${{ matrix.test-framework }}-nuget
|
||||
${{ runner.os }}-nuget
|
||||
|
||||
- name: Test
|
||||
run: dotnet test --nologo --verbosity normal --logger GitHubActions --framework ${{ matrix.test-framework }}
|
||||
run: dotnet test --nologo --verbosity normal --logger GitHubActions
|
||||
|
||||
deploy:
|
||||
# Publish only when creating a GitHub Release
|
||||
|
||||
Reference in New Issue
Block a user