-
Notifications
You must be signed in to change notification settings - Fork 74
84 lines (82 loc) · 3.25 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: CI
on:
push:
branches: [ master ]
pull_request: ~
jobs:
lint:
runs-on: windows-2019
steps:
- name: Install dotnet-format
run: dotnet tool install -g dotnet-format
- uses: actions/checkout@v2
- name: Check dotnet Style
run: dotnet-format --check --exclude /
NET_Tests:
# derived from https://dev.to/felipetofoli/github-actions-for-net-full-framework-build-and-test-299h
runs-on: windows-2022
env:
EASYPOST_TEST_API_KEY: ${{ secrets.EASYPOST_TEST_API_KEY }}
EASYPOST_PROD_API_KEY: ${{ secrets.EASYPOST_PROD_API_KEY }}
strategy:
matrix:
platform: [ 'NetFramework35', 'NetCore31', 'Net50', 'Net60' ]
steps:
- uses: actions/checkout@v2
with:
submodules: true
# Set the project name, based on platform version currently selected
- name: Set up variables
id: test_project
run: echo "::set-output name=test_file::EasyPost.Tests.${{ matrix.platform }}"
# install MSBuild, used to build the test project
- name: Setup MSBuild
uses: microsoft/[email protected]
# install NuGet.exe to restore required NuGet packages
- name: Setup Nuget
uses: NuGet/[email protected]
# install Visual Studio's console test application, to execute tests
- name: Setup VSTest
uses: darenm/Setup-VSTest@v1
# Restore required NuGet packages
- name: Restore NuGet Packages
run: nuget restore EasyPost.sln
# Build the test project
- name: Build Solution
run: msbuild ${{ steps.test_project.outputs.test_file }}\${{ steps.test_project.outputs.test_file }}.csproj /p:platform="Any CPU" /p:configuration="Debug" /p:outputPath="bin/Test" /p:target="Rebuild" -restore
# Run the tests
- name: Run Tests
run: vstest.console.exe ${{ steps.test_project.outputs.test_file }}\bin\Test\${{ steps.test_project.outputs.test_file }}.dll
Compatibility_Tests:
runs-on: windows-2022
strategy:
matrix:
platform: [ 'VB', 'FSharp' ]
include:
- platform: VB
ext: vbproj
- platform: FSharp
ext: fsproj
steps:
- uses: actions/checkout@v2
with:
submodules: true
# Set the project name, based on platform version currently selected
- name: Set up variables
id: test_project
run: echo "::set-output name=test_file::EasyPost.Tests.${{ matrix.platform }}"
# install MSBuild, used to build the test project
- name: Setup MSBuild
uses: microsoft/[email protected]
# install NuGet.exe to restore required NuGet packages
- name: Setup Nuget
uses: NuGet/[email protected]
# install Visual Studio's console test application, to execute tests
- name: Setup VSTest
uses: darenm/Setup-VSTest@v1
# Restore required NuGet packages
- name: Restore NuGet Packages
run: nuget restore EasyPost.sln
# Build the test project
- name: Build Solution
run: msbuild ${{ steps.test_project.outputs.test_file }}\${{ steps.test_project.outputs.test_file }}.${{ matrix.ext }} /p:platform="Any CPU" /p:configuration="Debug" /p:outputPath="bin/Test" /p:target="Rebuild" -restore