Skip to content

Commit 6e875f8

Browse files
committed
split test and publish jobs
1 parent 820e4d7 commit 6e875f8

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

.github/workflows/publish-site.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,29 @@ on:
33
push:
44
branches:
55
- main # Default release branch
6+
pull_request:
67
workflow_dispatch:
78

89
jobs:
10+
test:
11+
name: Verify provided solutions
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: restore submodules
16+
run: git submodule update --init
17+
- name: Setup .NET Core
18+
uses: actions/setup-dotnet@v2
19+
with:
20+
dotnet-version: 8.0.x
21+
- name: Install dependencies
22+
run: dotnet restore
23+
- name: Test
24+
run: dotnet test LearnJsonEverything.sln -c Release --no-restore
925
publish:
10-
name: build, pack & publish
26+
name: pack & publish
1127
runs-on: ubuntu-latest
28+
if: env.BRANCH == 'main'
1229
steps:
1330
- uses: actions/checkout@v3
1431
- name: restore submodules
@@ -21,8 +38,6 @@ jobs:
2138
run: dotnet restore
2239
- name: Pre-build solution
2340
run: dotnet build LearnJsonEverything.sln -c Release --no-restore
24-
- name: Test
25-
run: dotnet test LearnJsonEverything.sln -c Release --no-restore
2641
- name: Publish
2742
run: dotnet publish LearnJsonEverything/LearnJsonEverything.csproj -c Release --no-restore -o bin
2843
- name: Add .nojekyll file

0 commit comments

Comments
 (0)