11name : Ref Impl
2-
32on :
43 push :
54 branches : [ master ]
65 pull_request :
76 branches : [ master ]
8-
97jobs :
8+ core :
9+ runs-on : ubuntu-latest
10+ strategy :
11+ fail-fast : false
12+ matrix :
13+ mode : ['random', 'controlled']
14+ profile : ['all-features', 'single-seller', 'no-payment-reconciliation', 'no-auth']
15+ steps :
16+ - name : Checkout OpenActive.Server.NET
17+ uses : actions/checkout@v2
18+ with :
19+ path : server
20+ - name : Use matching coverage/* branch ${{ github.head_ref }} in OpenActive Test Suite
21+ if : ${{ startsWith(github.head_ref, 'coverage/') }}
22+ id : refs
23+ run : echo "::set-output name=mirror_ref::${{ github.head_ref }}"
24+ - name : Checkout OpenActive Test Suite ${{ steps.refs.outputs.mirror_ref }}
25+ uses : actions/checkout@v2
26+ with :
27+ repository : openactive/openactive-test-suite
28+ ref : ${{ steps.refs.outputs.mirror_ref }}
29+ path : tests
30+ - name : Setup .NET Core 2.1.808 for Booking Server Reference Implementation
31+ uses : actions/setup-dotnet@v1
32+ with :
33+ dotnet-version : 2.1.808
34+ - name : Setup .NET Core 3.0.103 for Authentication Authority Reference Implementation
35+ uses : actions/setup-dotnet@v1
36+ with :
37+ dotnet-version : 3.0.103
38+ - name : Setup Node.js 14.x
39+ uses : actions/setup-node@v1
40+ with :
41+ node-version : 14.x
42+ - name : Install OpenActive.Server.NET dependencies
43+ if : ${{ matrix.profile != 'no-auth' && matrix.profile != 'single-seller' }}
44+ run : dotnet restore ./server/
45+ - name : Build .NET Core Authentication Authority Reference Implementation
46+ if : ${{ matrix.profile != 'no-auth' && matrix.profile != 'single-seller' }}
47+ run : dotnet build ./server/Examples/BookingSystem.AspNetCore.IdentityServer/BookingSystem.AspNetCore.IdentityServer.csproj --configuration Release --no-restore
48+ - name : Start .NET Core Authentication Authority Reference Implementation
49+ if : ${{ matrix.profile != 'no-auth' && matrix.profile != 'single-seller' }}
50+ run : |
51+ dotnet run --no-launch-profile --project ./server/Examples/BookingSystem.AspNetCore.IdentityServer/BookingSystem.AspNetCore.IdentityServer.csproj --configuration Release --no-build &
52+ - name : Build .NET Core Booking Server Reference Implementation
53+ run : dotnet build ./server/Examples/BookingSystem.AspNetCore/BookingSystem.AspNetCore.csproj --configuration Release ${{ matrix.profile != 'no-auth' && matrix.profile != 'single-seller' && '--no-restore' || '' }}
54+ - name : Start .NET Core Booking Server Reference Implementation
55+ run : |
56+ dotnet run --no-launch-profile --project ./server/Examples/BookingSystem.AspNetCore/BookingSystem.AspNetCore.csproj --configuration Release --no-build &
57+ env :
58+ ASPNETCORE_ENVIRONMENT : ${{ matrix.profile }}
59+ - name : Install OpenActive Test Suite
60+ run : npm install
61+ working-directory : tests
62+ - name : Run OpenActive Integration Tests in ${{ matrix.mode }} mode
63+ run : npm start
64+ env :
65+ FORCE_COLOR : 1
66+ NODE_CONFIG : |
67+ {"broker": {"outputPath": "../../output/"}, "integrationTests": { "outputPath": "../../output/", "conformanceCertificatePath": "../../conformance/examples/${{ matrix.profile }}/${{ matrix.mode }}/", "useRandomOpportunities": ${{ matrix.mode == 'random' }}, "conformanceCertificateId": "https://certificates.reference-implementation.openactive.io/examples/${{ matrix.profile }}/${{ matrix.mode }}/" }}
68+ NODE_ENV : .example.${{ matrix.profile }}
69+ NODE_APP_INSTANCE : ci
70+ working-directory : tests
71+ - name : Upload test output for ${{ matrix.mode }} mode as artifact
72+ uses : actions/upload-artifact@v2
73+ if : ${{ success() || failure() }}
74+ with :
75+ name : core.${{ matrix.mode }}.${{ matrix.profile }}
76+ path : ./tests/output/
77+ - name : Deploy conformance certificate to Azure Blob Storage (master branch for 'all-features' profile in controlled mode only)
78+ uses : bacongobbler/azure-blob-storage-upload@v1.2.0
79+ if : ${{ github.ref == 'refs/heads/master' }}
80+ with :
81+ source_dir : ./tests/conformance/
82+ container_name : ' $web'
83+ connection_string : ${{ secrets.CONFORMANCE_CERTIFICATE_BLOB_STORAGE_CONNECTION_STRING }}
84+ sync : false
85+ framework :
86+ runs-on : windows-latest
87+ strategy :
88+ fail-fast : false
89+ matrix :
90+ mode : ['random', 'controlled']
91+ profile : ['no-auth']
92+ steps :
93+ - name : Checkout OpenActive.Server.NET
94+ uses : actions/checkout@v2
95+ with :
96+ path : server
97+ - name : Use matching coverage/* branch ${{ github.head_ref }} in OpenActive Test Suite
98+ if : ${{ startsWith(github.head_ref, 'coverage/') }}
99+ id : refs
100+ run : echo "::set-output name=mirror_ref::${{ github.head_ref }}"
101+ - name : Checkout OpenActive Test Suite ${{ steps.refs.outputs.mirror_ref }}
102+ uses : actions/checkout@v2
103+ with :
104+ repository : openactive/openactive-test-suite
105+ ref : ${{ steps.refs.outputs.mirror_ref }}
106+ path : tests
107+ - name : Setup Node.js 14.x
108+ uses : actions/setup-node@v1
109+ with :
110+ node-version : 14.x
111+ - name : Setup MSBuild path
112+ uses : microsoft/setup-msbuild@v1.0.2
113+ - name : Setup NuGet
114+ uses : NuGet/setup-nuget@v1.0.5
115+ - name : Install OpenActive.Server.NET dependencies
116+ run : nuget restore .\server\
117+ - name : Build .NET Framework Reference Implementation
118+ run : msbuild .\server\Examples\BookingSystem.AspNetFramework\BookingSystem.AspNetFramework.csproj /p:Configuration=Release
119+ - name : Deploy .NET Framework Reference Implementation to folder
120+ run : msbuild .\server\Examples\BookingSystem.AspNetFramework\BookingSystem.AspNetFramework.csproj /p:Configuration=Release /p:DeployOnBuild=true /t:WebPublish /p:WebPublishMethod=FileSystem /p:publishUrl=${{ runner.temp }}\deploy\ /p:PackageAsSingleFile=false
121+ - name : Start .NET Framework Reference Implementation from folder (using IIS Express)
122+ run : |
123+ Start-Process -FilePath "$Env:Programfiles\IIS Express\iisexpress.exe" -ArgumentList "/path:${{ runner.temp }}\deploy\ /port:5000"
124+ - name : Install OpenActive Test Suite
125+ run : npm install
126+ working-directory : tests
127+ - name : Run OpenActive Integration Tests in ${{ matrix.mode }} mode
128+ run : npm start
129+ env :
130+ FORCE_COLOR : 1
131+ NODE_CONFIG : |
132+ {"broker": {"outputPath": "../../output/"}, "integrationTests": {"outputPath": "../../output/", "useRandomOpportunities": ${{ matrix.mode == 'random' }}, "conformanceCertificateId": "https://openactive.io/OpenActive.Server.NET/certification/"}}
133+ NODE_ENV : .example.${{ matrix.profile }}
134+ NODE_APP_INSTANCE : framework
135+ working-directory : tests
136+ - name : Upload test output for ${{ matrix.mode }} mode as artifact
137+ uses : actions/upload-artifact@v2
138+ if : ${{ success() || failure() }}
139+ with :
140+ name : framework.${{ matrix.mode }}.${{ matrix.profile }}
141+ path : ./tests/output/
10142 deploy-reference-implementation :
11143 # Master branch only
12144 if : ${{ github.ref == 'refs/heads/master' }}
13-
145+ needs :
146+ - core
147+ - framework
14148 runs-on : ubuntu-latest
15149 steps :
16-
17150 # Checkout the repo
18151 - uses : actions/checkout@master
19-
20152 # Setup .NET Core SDK
21153 - name : Setup .NET Core 2.1.808
22154 uses : actions/setup-dotnet@v1
@@ -26,29 +158,24 @@ jobs:
26158 uses : actions/setup-dotnet@v1
27159 with :
28160 dotnet-version : 3.0.103
29-
30161 # Run dotnet build and publish
31162 - name : Install OpenActive.Server.NET dependencies
32163 run : dotnet restore
33-
34164 - name : Build OpenActive.Server.NET Booking Server Reference Implementation
35165 run : dotnet build ./Examples/BookingSystem.AspNetCore/BookingSystem.AspNetCore.csproj --configuration Release --no-restore
36166 - name : Publish OpenActive.Server.NET Booking Server Reference Implementation
37167 run : dotnet publish ./Examples/BookingSystem.AspNetCore/BookingSystem.AspNetCore.csproj --configuration Release --no-build --output './web-app-package/BookingSystem.AspNetCore'
38-
39168 - name : Build OpenActive.Server.NET Authentication Authority Reference Implementation
40169 run : dotnet build ./Examples/BookingSystem.AspNetCore.IdentityServer/BookingSystem.AspNetCore.IdentityServer.csproj --configuration Release --no-restore
41170 - name : Publish OpenActive.Server.NET Authentication Authority Reference Implementation
42171 run : dotnet publish ./Examples/BookingSystem.AspNetCore.IdentityServer/BookingSystem.AspNetCore.IdentityServer.csproj --configuration Release --no-build --output './web-app-package/BookingSystem.AspNetCore.IdentityServer'
43-
44172 # Deploy to Azure Web apps
45173 - name : ' Deploy Booking Server Reference Implementation using publish profile credentials'
46174 uses : azure/webapps-deploy@v2
47175 with :
48176 app-name : openactive-reference-implementation
49177 publish-profile : ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} # Define secret variable in repository settings as per action documentation
50178 package : ' ./web-app-package/BookingSystem.AspNetCore'
51-
52179 - name : ' Deploy Authentication Authority Reference Implementation using publish profile credentials'
53180 uses : azure/webapps-deploy@v2
54181 with :
0 commit comments