Skip to content

Commit

Permalink
Try reusable flow
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisDyallo committed May 6, 2024
1 parent 5f39837 commit d7ccb24
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/build-pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ on:
- '.github/workflows/build-pull-requests.yml'

jobs:
test:
name: Run tests
uses: ./.github/workflows/test.yml
build:
# Give this job a friendly name to show in GitHub UI.
name: Build and test
name: Build
runs-on: windows-latest

steps:
# Checkout the local repository
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
Expand All @@ -45,14 +46,9 @@ jobs:
- name: Add local NuGet repository
run: dotnet nuget add source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/Yubico/index.json"

# Build the project
- name: Build Yubico.NET.SDK.sln
run: dotnet build --configuration ReleaseWithDocs --nologo --verbosity normal Yubico.NET.SDK.sln

- name: Run tests
uses: ./.github/workflows/test.yml

# Save the built NuGet packages, just in case we need to inspect the build output.
- name: Save build artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ permissions:
packages: write

jobs:
test:
name: Run tests
uses: ./.github/workflows/test.yml

build:
name: Build, test, save artefacts
name: Build, save artefacts
runs-on: windows-2019

steps:
Expand All @@ -75,10 +79,6 @@ jobs:
- name: Build Yubico.NET.SDK.sln
run: dotnet build --configuration ReleaseWithDocs --nologo --verbosity normal Yubico.NET.SDK.sln

# Run tests
- name: Run tests
uses: ./.github/workflows/test.yml

# Upload artifacts
- name: Save documentation artifacts
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
uses: ./.github/workflows/test-macos.yml
coverage:
runs-on: ubuntu-latest
needs: [test-windows]
needs: [test-windows] # No need to gather coverage on all platforms
steps:
- uses: actions/download-artifact@v4
- name: Combine Coverage Reports # This is because one report is produced per project, and we want one result for all of them.
Expand Down

0 comments on commit d7ccb24

Please sign in to comment.