forked from dapr/dotnet-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
153 lines (150 loc) · 5.33 KB
/
itests.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
name: integration-test
on:
push:
branches:
- master
- release-*
tags:
- v*
pull_request:
branches:
- master
- release-*
jobs:
build:
name: run integration tests
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: ['3.1', '6.0', '7.0']
include:
- dotnet-version: '3.1'
install-3: true
display-name: '.NET Core 3.1'
framework: 'netcoreapp3.1'
prefix: 'netcoreapp31'
install-version: '3.1.x' # We always need a new .NET
- dotnet-version: '6.0'
install-3: false
display-name: '.NET 6.0'
framework: 'net6'
prefix: 'net6'
install-version: '6.0.x'
- dotnet-version: '7.0'
install-3: false
display-name: '.NET 7.0'
framework: 'net7'
prefix: 'net7'
install-version: '7.0.x'
env:
NUPKG_OUTDIR: bin/Release/nugets
GOVER: 1.19
GOOS: linux
GOARCH: amd64
GOPROXY: https://proxy.golang.org
DAPR_CLI_VER: 1.9.1
DAPR_RUNTIME_VER: 1.9.5
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/3dacfb672d55f1436c249057aaebbe597e1066f3/install/install.sh
DAPR_CLI_REF: ''
DAPR_REF: '82e097134cdc7494c5c3be71bf80f7904d6db9ea'
steps:
- name: Set up Dapr CLI
run: wget -q ${{ env.DAPR_INSTALL_URL }} -O - | /bin/bash -s ${{ env.DAPR_CLI_VER }}
- name: Set up Go ${{ env.GOVER }}
if: env.DAPR_REF != '' || env.DAPR_CLI_REF != ''
uses: actions/setup-go@v2
with:
go-version: ${{ env.GOVER }}
- name: Checkout Dapr CLI repo to override dapr command.
uses: actions/checkout@v2
if: env.DAPR_CLI_REF != ''
with:
repository: dapr/cli
ref: ${{ env.DAPR_CLI_REF }}
path: cli
- name: Checkout Dapr repo to override daprd.
uses: actions/checkout@v2
if: env.DAPR_REF != ''
with:
repository: dapr/dapr
ref: ${{ env.DAPR_REF }}
path: dapr
- name: Build and override dapr cli with referenced commit.
if: env.DAPR_CLI_REF != ''
run: |
cd cli
make
sudo cp dist/linux_amd64/release/dapr /usr/local/bin/dapr
cd ..
- name: Initialize Dapr runtime ${{ env.DAPR_RUNTIME_VER }}
run: |
dapr uninstall --all
dapr init --runtime-version ${{ env.DAPR_RUNTIME_VER }}
- name: Build and override daprd with referenced commit.
if: env.DAPR_REF != ''
run: |
cd dapr
make
mkdir -p $HOME/.dapr/bin/
cp dist/linux_amd64/release/daprd $HOME/.dapr/bin/daprd
cd ..
- name: Override placement service.
if: env.DAPR_REF != ''
run: |
docker stop dapr_placement
cd dapr
./dist/linux_amd64/release/placement &
- uses: actions/checkout@v1
- name: Parse release version
run: python ./.github/scripts/get_release_version.py
- name: Install Local kafka using docker-compose
run: |
docker-compose -f test/Dapr.E2E.Test/deploy/local-test-kafka.yml up -d
docker ps
- name: Install Local Hashicorp Vault using docker-compose
run: |
docker-compose -f test/Dapr.E2E.Test/deploy/local-test-vault.yml up -d
docker ps
- name: Setup Vault's test token
run: echo myroot > /tmp/.hashicorp_vault_token
- name: Setup ${{ matrix.display-name }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.install-version }}
- name: Setup .NET 7.0 # net7 is always required.
uses: actions/setup-dotnet@v1
if: ${{ matrix.install-version != '7.0.x' }}
with:
dotnet-version: 7.0.x
- name: Build
# disable deterministic builds, just for test run. Deterministic builds break coverage for some reason
run: dotnet build --configuration release /p:GITHUB_ACTIONS=false
- name: Run Test
id: tests
continue-on-error: true # proceed if tests fail, the report step will report the failure with more details.
run: |
dotnet test ${{ github.workspace }}/test/Dapr.E2E.Test/Dapr.E2E.Test.csproj \
--configuration Release \
--framework ${{ matrix.framework }} \
--no-build \
--no-restore \
--logger "trx;LogFilePrefix=${{ matrix.prefix }}" \
--logger "GitHubActions;report-warnings=false" \
--results-directory "${{ github.workspace }}/TestResults" \
/p:CollectCoverage=true \
/p:CoverletOutputFormat=opencover \
/p:GITHUB_ACTIONS=false
- name: Check test failure in PR
if: github.event_name == 'pull_request' && steps.tests.outcome != 'success'
run: exit 1
- name: Upload test coverage
uses: codecov/codecov-action@v1
with:
flags: ${{ matrix.framework }}
- name: Parse Trx files
uses: NasAmin/trx-parser@v0.1.0
id: trx-parser
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository # does not work on PRs from forks
with:
TRX_PATH: ${{ github.workspace }}/TestResults
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}