forked from ConsumerDataRight/mock-register
-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (91 loc) · 3.43 KB
/
dotnet.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
name: Build and Test
on:
push:
branches: [ main, develop ]
paths-ignore:
# Any update here needs to be done for
# - `pull_request` see below
- '*.md'
- '.github/ISSUE_TEMPLATE/**'
- '.github/pull_request_template.md'
- '.github/stale.yml'
- 'LICENSE'
pull_request:
branches: [ main, develop ]
types: [opened, synchronize, reopened]
paths-ignore:
# Any update here needs to be done for
# - `push`see before
- '*.md'
- '.github/ISSUE_TEMPLATE/**'
- '.github/pull_request_template.md'
- '.github/stale.yml'
- 'LICENSE'
env:
buildConfiguration: 'Release'
buildRuntime: 'win-x64'
runEnvironment: 'Release'
ASPNETCORE_ENVIRONMENT: 'Release'
jobs:
build-and-test:
runs-on: ubuntu-latest
## NOTE: This workflow needs to also checkout the Mock Register for testing.
## This workflow will checkout the ConsumerDataRight/mock-register project
steps:
- name: Checkout Register
uses: actions/checkout@v2
with:
path: ./mock-register
# Build mock-register image
- name: Build the mock-register image
run: |
docker build ./mock-register/Source --file ./mock-register/Source/Dockerfile --tag mock-register:latest
# Build mock-register-unit-tests image
- name: Build the mock-register-unit-tests image
run: |
docker build ./mock-register/Source --file ./mock-register/Source/Dockerfile.unit-tests --tag mock-register-unit-tests:latest
# Build mock-register-integration-tests image
- name: Build the mock-register-integration-tests image
run: |
docker build ./mock-register/Source --file ./mock-register/Source/Dockerfile.integration-tests --tag mock-register-integration-tests:latest
# List docker images
- name: List Docker images
run: |
docker images
# Run unit tests
- name: Run unit tests
run: |
docker compose -f ./mock-register/Source/docker-compose.UnitTests.yml up --abort-on-container-exit --exit-code-from mock-register-unit-tests
# Remove unit tests
- name: Remove unit tests
run: |
docker compose -f ./mock-register/Source/docker-compose.UnitTests.yml down
# Run integration tests
- name: Run integration tests
run: |
docker compose -f ./mock-register/Source/docker-compose.IntegrationTests.yml up --abort-on-container-exit --exit-code-from mock-register-integration-tests
# Remove integration tests
- name: Remove integration tests
run: |
docker compose -f ./mock-register/Source/docker-compose.IntegrationTests.yml down
# Archive unit test results
- name: Archive unit test results
uses: actions/upload-artifact@v2
if: always()
with:
name: unit-test-results
path: ${{ github.workspace }}/mock-register/Source/_temp/mock-register-unit-tests/testresults
# Archive integration test results
- name: Archive integration test results
uses: actions/upload-artifact@v2
if: always()
with:
name: integration-test-results
path: ${{ github.workspace }}/mock-register/Source/_temp/mock-register-integration-tests/testresults
# Archive mock register logs
- name: Archive mock register logs
uses: actions/upload-artifact@v2
if: always()
with:
name: integration-test-artifacts
path: ${{ github.workspace }}/mock-register/Source/_temp/mock-register/tmp