Skip to content

Commit 0d67a94

Browse files
committed
with shared projects
1 parent 8ea6f52 commit 0d67a94

1 file changed

Lines changed: 30 additions & 37 deletions

File tree

.github/workflows/main.yml

Lines changed: 30 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
name: main
22
on:
33
push:
4-
branches:
5-
- master
6-
- feature/3.1
7-
paths:
8-
- src/**
9-
- tests/**
10-
- .github/workflows/main.yml
4+
branches: [master, feature/3.1]
5+
paths: [src/**, tests/**, .github/workflows/main.yml]
116
workflow_dispatch:
12-
7+
8+
env:
9+
TEST_PROJECTS: "Sdcb.PaddleInference.Tests \
10+
Sdcb.PaddleNLP.Lac.Tests \
11+
Sdcb.PaddleOCR.Tests \
12+
Sdcb.RotationDetector.Tests"
13+
1314
jobs:
1415
build:
1516
runs-on: ubuntu-22.04
@@ -23,13 +24,15 @@ jobs:
2324
- name: Build code
2425
run: dotnet build -c Debug -p:Optimize=true
2526

26-
- name: Create as artifacts
27+
- name: Create test artifacts
2728
run: |
28-
mkdir -p test-artifacts
29-
rsync -a --mkpath tests/Sdcb.PaddleInference.Tests/bin/Debug/net8.0/ test-artifacts/Sdcb.PaddleInference.Tests
30-
rsync -a --mkpath tests/Sdcb.PaddleNLP.Lac.Tests/bin/Debug/net8.0/ test-artifacts/Sdcb.PaddleNLP.Lac.Tests
31-
rsync -a --mkpath tests/Sdcb.PaddleOCR.Tests/bin/Debug/net8.0/ test-artifacts/Sdcb.PaddleOCR.Tests
32-
rsync -a --mkpath tests/Sdcb.RotationDetector.Tests/bin/Debug/net8.0/ test-artifacts/Sdcb.RotationDetector.Tests
29+
for proj in $TEST_PROJECTS; do
30+
echo "::group::Create artifacts for $proj""
31+
dst="test-artifacts/$proj"
32+
mkdir -p "$dst"
33+
cp -r "tests/$proj/bin/Debug/net8.0/"* "$dst/"
34+
echo "::endgroup::"
35+
done
3336
3437
- name: Upload artifacts
3538
uses: actions/upload-artifact@v4
@@ -38,36 +41,26 @@ jobs:
3841
path: test-artifacts
3942

4043
run:
41-
runs-on: ${{ matrix.runs-on }}
44+
runs-on: ${{ matrix.os }}
4245
strategy:
4346
matrix:
44-
runs-on: [windows-2022, windows-2025, ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm, macos-13, macos-14, macos-15]
47+
os: [windows-2022, windows-2025,
48+
ubuntu-22.04, ubuntu-24.04,
49+
ubuntu-22.04-arm, ubuntu-24.04-arm,
50+
macos-13, macos-14, macos-15]
4551
needs: build
4652
steps:
47-
- name: Download artifacts
48-
uses: actions/download-artifact@v4
53+
- uses: actions/download-artifact@v4
4954
with:
5055
name: test-artifacts
5156

5257
- name: Test
5358
shell: bash
5459
run: |
55-
echo "::group::Run Sdcb.PaddleInference.Tests"
56-
cd ~/test-artifacts/Sdcb.PaddleInference.Tests
57-
dotnet test -c Debug --no-build --verbosity detailed -p:Optimize=true Sdcb.PaddleInference.Tests.dll
58-
echo "::endgroup::"
59-
60-
echo "::group::Run Sdcb.PaddleNLP.Lac.Tests"
61-
cd ~/test-artifacts/Sdcb.PaddleNLP.Lac.Tests
62-
dotnet test -c Debug --no-build --verbosity detailed -p:Optimize=true Sdcb.PaddleNLP.Lac.Tests.dll
63-
echo "::endgroup::"
64-
65-
echo "::group::Run Sdcb.PaddleOCR.Tests"
66-
cd ~/test-artifacts/Sdcb.PaddleOCR.Tests
67-
dotnet test -c Debug --no-build --verbosity detailed -p:Optimize=true Sdcb.PaddleOCR.Tests.dll
68-
echo "::endgroup::"
69-
70-
echo "::group::Run Sdcb.RotationDetector.Tests"
71-
cd ~/test-artifacts/Sdcb.RotationDetector.Tests
72-
dotnet test -c Debug --no-build --verbosity detailed -p:Optimize=true Sdcb.RotationDetector.Tests.dll
73-
echo "::endgroup::"
60+
for proj in $TEST_PROJECTS; do
61+
echo "::group::Run $proj"
62+
dotnet test \
63+
"$PWD/test-artifacts/$proj/$proj.dll" \
64+
-c Debug --no-build --verbosity detailed -p:Optimize=true
65+
echo "::endgroup::"
66+
done

0 commit comments

Comments
 (0)