-
Notifications
You must be signed in to change notification settings - Fork 9
126 lines (112 loc) · 5.09 KB
/
reference-implementation.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: Reference Implementation
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
tests:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
mode: ['random', 'controlled']
profile: ['all-features', 'single-seller', 'no-payment-reconciliation', 'no-auth', 'no-tax-calculation', 'prepayment-always-required', 'facilityuse-has-slots']
flow: ['simple', 'approval']
include:
- mode: 'random'
profile: 'all-features'
flow: 'both'
- mode: 'controlled'
profile: 'all-features'
flow: 'both'
concurrency:
group: openactive-test-suite--${{ github.head_ref }}--${{ matrix.mode }}.${{ matrix.profile }}.${{ matrix.flow }}
cancel-in-progress: true
steps:
- name: Checkout OpenActive Test Suite
uses: actions/checkout@v4
with:
path: tests
- name: Use matching coverage/* branch ${{ github.head_ref }} in OpenActive.Server.NET
if: ${{ startsWith(github.head_ref, 'coverage/') }}
id: refs
run: echo "::set-output name=mirror_ref::${{ github.head_ref }}"
- name: Checkout OpenActive.Server.NET ${{ steps.refs.outputs.mirror_ref }}
uses: actions/checkout@v4
with:
repository: openactive/OpenActive.Server.NET
ref: ${{ steps.refs.outputs.mirror_ref }}
path: server
- name: Setup .NET Core SDK 3.1.419
uses: actions/setup-dotnet@v4
with:
dotnet-version: 3.1.419
- name: Setup Node.js 18.17.1
uses: actions/setup-node@v4
with:
node-version: 18.17.1
- name: Install OpenActive.Server.NET dependencies
run: dotnet restore ./server/
- name: Build .NET Core Authentication Authority Reference Implementation
run: dotnet build ./server/Examples/BookingSystem.AspNetCore.IdentityServer/BookingSystem.AspNetCore.IdentityServer.csproj --configuration Release --no-restore
- name: Start .NET Core Authentication Authority Reference Implementation
run: |
dotnet run --no-launch-profile --project ./server/Examples/BookingSystem.AspNetCore.IdentityServer/BookingSystem.AspNetCore.IdentityServer.csproj --configuration Release --no-build &
- name: Build .NET Core Booking Server Reference Implementation
run: dotnet build ./server/Examples/BookingSystem.AspNetCore/BookingSystem.AspNetCore.csproj --configuration Release --no-restore
- name: Start .NET Core Booking Server Reference Implementation
run: |
dotnet run --no-launch-profile --project ./server/Examples/BookingSystem.AspNetCore/BookingSystem.AspNetCore.csproj --configuration Release --no-build &
env:
ASPNETCORE_ENVIRONMENT: ${{ matrix.profile }}
- name: Install OpenActive Test Suite
run: |
npm install
working-directory: tests
- name: Run OpenActive Integration Tests in ${{ matrix.mode }} mode
run: npm start
env:
FORCE_COLOR: 1
NODE_CONFIG: |
{"broker": {"outputPath": "../../output/"}, "integrationTests": {"outputPath": "../../output/", "useRandomOpportunities": ${{ matrix.mode == 'random' }}, "implementedFeatures": { "minimal-proposal": ${{ matrix.flow == 'approval' || matrix.flow == 'both' }}, "proposal-amendment": ${{ matrix.flow == 'approval' || matrix.flow == 'both' }} }, "bookingFlowsInScope": { "OpenBookingSimpleFlow": ${{ matrix.flow == 'simple' || matrix.flow == 'both' }}, "OpenBookingApprovalFlow": ${{ matrix.flow == 'approval' || matrix.flow == 'both' }} } }}
NODE_ENV: .example.${{ matrix.profile }}
NODE_APP_INSTANCE: ci
working-directory: tests
# Two purposes to uploading the output from these tests:
# 1. So that the `deploy-output` job can use this output in order to publish it, as examples, to gh-pages
# 2. Make the artifact downloadable from GitHub to a developer so that they can debug
- name: Upload test output for ${{ matrix.mode }} mode as artifact
uses: actions/upload-artifact@v4
if: ${{ success() || failure() }}
with:
name: ${{ matrix.mode }}.${{ matrix.profile }}.${{ matrix.flow }}
path: ./tests/output/
deploy-output:
needs: tests
# Master branch only
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-22.04
steps:
# Checkout the repo to seed the contents of ./tests/publish/
- name: Checkout OpenActive Test Suite
uses: actions/checkout@v4
with:
path: tests
- name: Download test output for Random Mode
uses: actions/download-artifact@v4
with:
name: random.all-features.both
path: ./tests/publish/example-output/random/
- name: Download test output for Controlled Mode
uses: actions/download-artifact@v4
with:
name: controlled.all-features.both
path: ./tests/publish/example-output/controlled/
- name: Deploy test output to GitHub Pages (master branch on ubuntu only)
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./tests/publish
force_orphan: true
enable_jekyll: true