-
Notifications
You must be signed in to change notification settings - Fork 7
81 lines (65 loc) · 2.72 KB
/
build.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
name: Build
on:
push:
branches: [ main ]
paths-ignore:
- '**/README.md'
pull_request:
jobs:
build:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ACCEPT_EULA: Y
SQLSERVER_SA_PASSWORD: SqlSever123123
SQLSERVER_INTEGRATED_SECURITY: 'False'
POSTGRES_SA_USER: postgres
POSTGRES_SA_PASSWORD: Postgres123123
steps:
- name: Determine Git Checkout information
id: checkout-info
run: |
if [ $GITHUB_EVENT_NAME == 'pull_request' ]; then
BRANCH_NAME=$(echo ${{ github.event.pull_request.head.ref }})
REPOSITORY_NAME=$(echo ${{ github.event.pull_request.head.repo.full_name }})
else
BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})
REPOSITORY_NAME=$(echo ${{ github.repository }})
fi
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
echo "REPOSITORY_NAME=$REPOSITORY_NAME" >> $GITHUB_ENV
echo "Git checkout information:"
echo "Branch name: $BRANCH_NAME"
echo "Repository name: $REPOSITORY_NAME"
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore src/KafkaFlow.Retry.sln
- name: Build
run: dotnet build --no-restore -c Release src/KafkaFlow.Retry.sln
- name: Start SqlServer
run: docker run -d -p 1433:1433 -e ACCEPT_EULA=${{ env.ACCEPT_EULA }} -e SA_PASSWORD=${{ env.SQLSERVER_SA_PASSWORD }} -e MSSQL_PID=Developer mcr.microsoft.com/mssql/server:2017-latest
- name: Start Postgres
run: docker run -d -p 5432:5432 -e POSTGRES_USER=${{ env.POSTGRES_SA_USER }} -e POSTGRES_PASSWORD=${{ env.POSTGRES_SA_PASSWORD }} postgres:latest
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: '4.4'
#mongodb-port: 27017 (default)
- name: Start Kafka
uses: 280780363/[email protected]
with:
kafka version: "3.4.0-debian-11-r15" # Optional, kafka version
zookeeper version: "3.8.1-debian-11-r18" # Optional, zookeeper version
kafka port: 9092 # Optional, kafka port. Connect using localhost:9092
zookeeper port: 2181 # Optional, zookeeper port
auto create topic: "true" # Optional, auto create kafka topic
- name: Test
run: dotnet test --no-build -c Release --verbosity normal --collect:"XPlat Code Coverage" --results-directory:"../../coverage-outputs" -m:1 src/KafkaFlow.Retry.sln