Skip to content

Commit

Permalink
ci: snapshot test as standalone job
Browse files Browse the repository at this point in the history
  • Loading branch information
yufeih committed Mar 6, 2023
1 parent f60dbfb commit 7eb53a2
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 26 deletions.
28 changes: 28 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: build
description: build the project
runs:
using: "composite"
steps:
- uses: actions/setup-node@v3
with:
node-version: 16

- uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.x
7.x
- run: npm install
shell: bash
working-directory: templates

- run: npm run lint
shell: bash
working-directory: templates

- run: npm run build
shell: bash
working-directory: templates

- run: dotnet build -c Release
shell: bash
27 changes: 1 addition & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,8 @@ jobs:
os: [windows-latest, macos-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v3
with:
lfs: true
- uses: actions/setup-node@v3
with:
node-version: 16
- uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.x
7.x
- run: npm install
working-directory: templates

- run: npm run lint
working-directory: templates

- run: npm run build
working-directory: templates

- run: dotnet build -c Release

- run: choco install wkhtmltopdf
if: matrix.os == 'windows-latest'

- run: dotnet test -c Release --filter Stage=Snapshot --no-build --collect:"XPlat Code Coverage"
working-directory: test/docfx.Snapshot.Tests
- uses: ./.github/actions/build

- run: dotnet test -c Release -f net7.0 --filter Stage!=Snapshot --no-build --collect:"XPlat Code Coverage"

Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/snapshot-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: snapshot-test
on:
pull_request:
branches: [ main, feature/*, hotfix/* ]
push:
branches: [ main, feature/*, hotfix/* ]

jobs:
snapshot-test:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
lfs: true

- uses: ./.github/actions/build

- run: choco install wkhtmltopdf

- run: dotnet test -c Release -f net7.0 --no-build
working-directory: test/docfx.Snapshot.Tests

0 comments on commit 7eb53a2

Please sign in to comment.