Skip to content

Commit df3e6c2

Browse files
committed
fix: only install necessary frameworks for CI tests
1 parent e732f2b commit df3e6c2

File tree

1 file changed

+17
-30
lines changed

1 file changed

+17
-30
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,8 @@ jobs:
124124
EASYPOST_PROD_API_KEY: "123"
125125
strategy:
126126
matrix:
127-
name: ["Net60", "Net70", "Net80", "Net90"]
128-
include:
129-
- name: Net60
130-
framework: net6.0
131-
- name: Net70
132-
framework: net7.0
133-
- name: Net80
134-
framework: net8.0
135-
- name: Net90
136-
framework: net9.0
127+
framework: [net6.0, net7.0, net8.0, net9.0]
128+
dotnet-version: [6.x.x, 7.x.x, 8.x.x, 9.x.x]
137129
steps:
138130
- uses: actions/checkout@v4
139131
with:
@@ -142,11 +134,7 @@ jobs:
142134
- name: Install .NET SDK
143135
uses: actions/setup-dotnet@v4
144136
with:
145-
dotnet-version: |
146-
6.x.x
147-
7.x.x
148-
8.x.x
149-
9.x.x
137+
dotnet-version: ${{ matrix.dotnet-version }}
150138

151139
- name: Setup MSBuild
152140
uses: microsoft/setup-msbuild@v2
@@ -171,7 +159,7 @@ jobs:
171159

172160
# Run the unit tests in a specific framework (verify that the library works in that framework)
173161
- name: Run Tests
174-
run: make unit-test fw=${{ matrix.framework }}
162+
run: make unit-test FW=${{ matrix.framework }}
175163

176164
Integration_Tests:
177165
runs-on: windows-latest
@@ -203,9 +191,17 @@ jobs:
203191

204192
# Run the integration tests
205193
- name: Run Tests
206-
run: make integration-test fw=net9.0 # Always run integration tests on the latest framework
194+
run: make integration-test
195+
196+
# .NET Standard notes:
197+
# - NET Standard 2.0 is compatible with minimum .NET Framework 4.6.1: https://docs.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0
198+
# - GitHub's Windows 2022 runner only supports minimum .NET Framework 4.7.2 anyway: https://github.com/actions/virtual-environments/issues/5055#issuecomment-1040757930
199+
# - .NET Standard is not a framework, but a set of shared APIs between the old .NET Framework and new .NET/.NET Core
200+
# - `EasyPost` targets .NET Standard 2.0, meaning it is compatible with specific versions of both .NET and .NET Framework: https://docs.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0
201+
# - When you want to actually run code, however, you can't run it in .NET Standard. You have to run it in either .NET or .NET Framework: https://stackoverflow.com/a/48885500/13343799
202+
# - So, while `EasyPost` targets .NET Standard 2.0, `EasyPost.Compatibility.NetStandard`, the code we're actually executing, targets .NET Framework 4.7.2
203+
# - By extension, this is ensuring we are testing that the `EasyPost` source code can run in a .NET Framework environment
207204

208-
# See notes at the bottom of this file for more info on NetStandard compatibility tests
209205
NetStandard_Compatibility_Tests:
210206
runs-on: windows-2022
211207
steps:
@@ -231,7 +227,7 @@ jobs:
231227

232228
# Run the compatibility tests
233229
- name: Run Tests
234-
run: make netstandard-compat-test fw=net472
230+
run: make netstandard-compat-test FW=net472
235231

236232
FSharp_Compatibility_Tests:
237233
runs-on: windows-latest
@@ -263,7 +259,7 @@ jobs:
263259

264260
# Run the compatibility tests
265261
- name: Run Tests
266-
run: make fs-compat-test fw=net9.0 # Always run compatibility tests on the latest framework
262+
run: make fs-compat-test
267263

268264
Visual_Basic_Compatibility_Test:
269265
runs-on: windows-latest
@@ -295,13 +291,4 @@ jobs:
295291

296292
# Run the compatibility tests
297293
- name: Run Tests
298-
run: make vb-compat-test fw=net9.0 # Always run compatibility tests on the latest framework
299-
300-
# .NET Standard notes:
301-
# - NET Standard 2.0 is compatible with minimum .NET Framework 4.6.1: https://docs.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0
302-
# - GitHub's Windows 2022 runner only supports minimum .NET Framework 4.7.2 anyway: https://github.com/actions/virtual-environments/issues/5055#issuecomment-1040757930
303-
# - .NET Standard is not a framework, but a set of shared APIs between the old .NET Framework and new .NET/.NET Core
304-
# - `EasyPost` targets .NET Standard 2.0, meaning it is compatible with specific versions of both .NET and .NET Framework: https://docs.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0
305-
# - When you want to actually run code, however, you can't run it in .NET Standard. You have to run it in either .NET or .NET Framework: https://stackoverflow.com/a/48885500/13343799
306-
# - So, while `EasyPost` targets .NET Standard 2.0, `EasyPost.Compatibility.NetStandard`, the code we're actually executing, targets .NET Framework 4.7.2
307-
# - By extension, this is ensuring we are testing that the `EasyPost` source code can run in a .NET Framework environment
294+
run: make vb-compat-test

0 commit comments

Comments
 (0)