Skip to content

Commit

Permalink
Update build_and_test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Romfos authored Oct 8, 2023
1 parent 5319135 commit accdd03
Showing 1 changed file with 36 additions and 11 deletions.
47 changes: 36 additions & 11 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,30 @@ name: Build and Test
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x

- name: Restore dependencies
run: dotnet restore

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

- name: Save build to cache
- uses: actions/cache/save@v3
id: cache
with:
path: ./tests/NSubstitute.Acceptance.Specs/bin
key: ${{github.run_number}}

test:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macOS-latest]
Expand All @@ -12,21 +36,22 @@ jobs:
tfm: net462

runs-on: ${{ matrix.os }}
needs: [build]
steps:
- uses: actions/checkout@v3

- name: Checkout
uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
7.0.x
- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore
dotnet-version: 6.0.x

- uses: actions/cache/restore@v3
id: cache
with:
path: ./tests/NSubstitute.Acceptance.Specs/bin
key: ${{github.run_number}}

- name: Test
run: dotnet test -f ${{ matrix.tfm }} --no-build --no-restore

0 comments on commit accdd03

Please sign in to comment.