Skip to content

Commit

Permalink
Merge pull request #8 from Q42/ci-fixes
Browse files Browse the repository at this point in the history
ci: Make tests a reusable workflow
  • Loading branch information
TheMerski authored Feb 23, 2024
2 parents 2e694c4 + 82c0b4c commit d3b01bd
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 26 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,7 @@ env:

jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install dependencies
run: dotnet restore
- name: Test
run: dotnet test --no-build
uses: ./.github/workflows/test.yml

publish:
runs-on: ubuntu-latest
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Tests

on:
workflow_call:

jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: πŸ“₯ Restore dependencies
run: dotnet restore --verbosity normal
- name: πŸ”¨ Build
run: dotnet build --no-restore --verbosity normal
- name: πŸ“‹ Test
run: dotnet test --no-restore --verbosity normal
16 changes: 2 additions & 14 deletions .github/workflows/verify-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
branches:
- main
workflow_dispatch:
workflow_call:

jobs:
enforce-label:
Expand All @@ -21,17 +22,4 @@ jobs:
REQUIRED_LABELS_ANY_DESCRIPTION: "Select at least one label ['feature','bug','maintenance', 'dependencies', 'chore', 'ignore-for-release', 'major', 'minor', 'patch', 'github-actions']"

test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: πŸ“₯ Restore dependencies
run: dotnet restore --verbosity normal
- name: πŸ”¨ Build
run: dotnet build --no-restore --verbosity normal
- name: πŸ“‹ Test
run: dotnet test --no-restore --verbosity normal
uses: ./.github/workflows/test.yml

0 comments on commit d3b01bd

Please sign in to comment.