Skip to content

Commit 018a618

Browse files
authored
fix: eliminate OS waiting
1 parent c16a216 commit 018a618

1 file changed

Lines changed: 150 additions & 23 deletions

File tree

Lines changed: 150 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,184 @@
1-
name: Pipeline PR push
1+
name: Pipeline PR push
2+
23
on:
34
pull_request:
45

56
jobs:
6-
build:
7-
runs-on: ${{matrix.os}}
8-
strategy:
9-
matrix:
10-
os: [ubuntu-latest, windows-latest, macOS-latest]
7+
# === LINUX ===
8+
build-linux:
9+
runs-on: ubuntu-latest
1110
steps:
1211
- name: Checkout
1312
uses: actions/checkout@v4
1413
with:
1514
fetch-depth: 0
16-
15+
16+
- name: Cache NuGet packages
17+
uses: actions/cache@v4
18+
with:
19+
path: ~/.nuget/packages
20+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
21+
restore-keys: |
22+
${{ runner.os }}-nuget-
23+
1724
- name: Setup .NET 8 Environment
1825
uses: actions/setup-dotnet@v4
1926
with:
2027
dotnet-version: '8.0.x'
21-
- name: Create config file for ByteSync.Client
22-
run: echo '${{ secrets.CLIENT_LOCAL_SETTINGS_JSON}}' > src/ByteSync.Client/local.settings.json
23-
28+
29+
- name: Create config file
30+
shell: bash
31+
run: echo '${{ secrets.CLIENT_LOCAL_SETTINGS_JSON }}' > src/ByteSync.Client/local.settings.json
32+
2433
- run: dotnet restore --locked-mode
2534
- run: dotnet clean --verbosity quiet
2635
- run: dotnet build --verbosity quiet /property:WarningLevel=0
27-
28-
test:
29-
needs: build
30-
runs-on: ${{matrix.os}}
31-
strategy:
32-
matrix:
33-
os: [ubuntu-latest, windows-latest, macOS-latest]
34-
steps:
36+
37+
test-linux:
38+
needs: build-linux
39+
runs-on: ubuntu-latest
40+
steps:
3541
- name: Checkout
3642
uses: actions/checkout@v4
3743
with:
3844
fetch-depth: 0
45+
3946
- name: Setup .NET 8 Environment
4047
uses: actions/setup-dotnet@v4
4148
with:
4249
dotnet-version: '8.0.x'
43-
50+
4451
- run: dotnet restore --locked-mode
4552

4653
- name: Run Tests
47-
run : dotnet test
54+
run: dotnet test --no-restore --no-build
4855

49-
- name: Upload Test Results as Artifacts
56+
- name: Upload Test Results
5057
uses: actions/upload-artifact@v4
5158
with:
52-
name: PR-test-results-${{matrix.os}}
59+
name: PR-test-results-linux
5360
path: ./TestResults/*.trx
54-
61+
62+
- name: Show Failed Tests
63+
if: failure()
64+
run: echo "Some tests failed. Check uploaded artifacts for detailed logs."
65+
66+
67+
# === macOS ===
68+
build-mac:
69+
runs-on: macos-latest
70+
steps:
71+
- name: Checkout
72+
uses: actions/checkout@v4
73+
with:
74+
fetch-depth: 0
75+
76+
- name: Cache NuGet packages
77+
uses: actions/cache@v4
78+
with:
79+
path: ~/.nuget/packages
80+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
81+
restore-keys: |
82+
${{ runner.os }}-nuget-
83+
84+
- name: Setup .NET 8 Environment
85+
uses: actions/setup-dotnet@v4
86+
with:
87+
dotnet-version: '8.0.x'
88+
89+
- name: Create config file
90+
shell: bash
91+
run: echo '${{ secrets.CLIENT_LOCAL_SETTINGS_JSON }}' > src/ByteSync.Client/local.settings.json
92+
93+
- run: dotnet restore --locked-mode
94+
- run: dotnet clean --verbosity quiet
95+
- run: dotnet build --verbosity quiet /property:WarningLevel=0
96+
97+
test-mac:
98+
needs: build-mac
99+
runs-on: macos-latest
100+
steps:
101+
- name: Checkout
102+
uses: actions/checkout@v4
103+
with:
104+
fetch-depth: 0
105+
106+
- name: Setup .NET 8 Environment
107+
uses: actions/setup-dotnet@v4
108+
with:
109+
dotnet-version: '8.0.x'
110+
111+
- run: dotnet restore --locked-mode
112+
113+
- name: Run Tests
114+
run: dotnet test --no-restore --no-build
115+
116+
- name: Upload Test Results
117+
uses: actions/upload-artifact@v4
118+
with:
119+
name: PR-test-results-mac
120+
path: ./TestResults/*.trx
121+
122+
- name: Show Failed Tests
123+
if: failure()
124+
run: echo "Some tests failed. Check uploaded artifacts for detailed logs."
125+
126+
127+
# === WINDOWS ===
128+
build-win:
129+
runs-on: windows-latest
130+
steps:
131+
- name: Checkout
132+
uses: actions/checkout@v4
133+
with:
134+
fetch-depth: 0
135+
136+
- name: Cache NuGet packages
137+
uses: actions/cache@v4
138+
with:
139+
path: C:\Users\runneradmin\.nuget\packages
140+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
141+
restore-keys: |
142+
${{ runner.os }}-nuget-
143+
144+
- name: Setup .NET 8 Environment
145+
uses: actions/setup-dotnet@v4
146+
with:
147+
dotnet-version: '8.0.x'
148+
149+
- name: Create config file
150+
shell: bash
151+
run: echo '${{ secrets.CLIENT_LOCAL_SETTINGS_JSON }}' > src/ByteSync.Client/local.settings.json
152+
153+
- run: dotnet restore --locked-mode
154+
- run: dotnet clean --verbosity quiet
155+
- run: dotnet build --verbosity quiet /property:WarningLevel=0
156+
157+
test-win:
158+
needs: build-win
159+
runs-on: windows-latest
160+
steps:
161+
- name: Checkout
162+
uses: actions/checkout@v4
163+
with:
164+
fetch-depth: 0
165+
166+
- name: Setup .NET 8 Environment
167+
uses: actions/setup-dotnet@v4
168+
with:
169+
dotnet-version: '8.0.x'
170+
171+
- run: dotnet restore --locked-mode
172+
173+
- name: Run Tests
174+
run: dotnet test --no-restore --no-build
175+
176+
- name: Upload Test Results
177+
uses: actions/upload-artifact@v4
178+
with:
179+
name: PR-test-results-win
180+
path: ./TestResults/*.trx
181+
55182
- name: Show Failed Tests
56183
if: failure()
57184
run: echo "Some tests failed. Check uploaded artifacts for detailed logs."

0 commit comments

Comments
 (0)