-
Notifications
You must be signed in to change notification settings - Fork 9
169 lines (151 loc) · 6.46 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: Reference Implementation
on:
push:
branches: [ feature/docker-and-package-upgrades ]
pull_request:
branches: [ master ]
jobs:
tests:
runs-on: ubuntu-latest
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@v2
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@v2
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@v1
with:
dotnet-version: 3.1.419
- name: Setup Node.js 18.17.1
uses: actions/setup-node@v1
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@v2
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-latest
steps:
# Checkout the repo to seed the contents of ./tests/publish/
- name: Checkout OpenActive Test Suite
uses: actions/checkout@v2
with:
path: tests
- name: Download test output for Random Mode
uses: actions/download-artifact@v2
with:
name: random.all-features.both
path: ./tests/publish/example-output/random/
- name: Download test output for Controlled Mode
uses: actions/download-artifact@v2
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
build-and-push-docker-image:
# Publish to GitHub Container Registry
# Master branch only
# if: ${{ github.ref == 'refs/heads/master' }}
# needs:
# - tests
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
REGISTRY: ghcr.io
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for OpenActive Test Suite
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/openactive/test-suite
labels: |
org.opencontainers.image.title=OpenActive Test Suite
org.opencontainers.image.description=Test suite for OpenActive data publishing and Open Booking API implementations
org.opencontainers.image.vendor=OpenActive
tags: |
latest
- name: Build and push Docker image for OpenActive Test Suite
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}