-
Notifications
You must be signed in to change notification settings - Fork 7
112 lines (92 loc) · 2.95 KB
/
cd.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
name: CD
run-name: CD - ${{ github.event.release.tag_name }}
on:
workflow_dispatch:
release:
types: [published]
defaults:
run:
working-directory: src
jobs:
build:
name: 🛠️ Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
global-json-file: .config/global.json
- name: Build
run: dotnet build --configuration Release
test:
name: 🧪 Test
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: setup dotnet
uses: actions/setup-dotnet@v3
with:
global-json-file: .config/global.json
- name: test
run: dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=coverage/lcov.info --configuration Release
- name: Coveralls UnitTests
uses: coverallsapp/[email protected]
with:
path-to-lcov: test/dotnet-test-rerun.UnitTests/coverage/lcov.info
flag-name: UnitTests
- name: Coveralls IntegrationTests
uses: coverallsapp/[email protected]
with:
path-to-lcov: test/dotnet-test-rerun.IntegrationTests/coverage/lcov.info
flag-name: IntegrationTests
nuget:
name: 📦 Pack and Push nuget
runs-on: ubuntu-latest
needs: test
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup dotnet
uses: actions/setup-dotnet@v3
with:
global-json-file: .config/global.json
- name: Get version
uses: kzrnm/get-net-sdk-project-versions-action@v1
id: get-version
with:
proj-path: src/dotnet-test-rerun.csproj
- name: pack
run: dotnet pack --configuration Release
- name: push
run: dotnet nuget push nupkg/dotnet-test-rerun.${{steps.get-version.outputs.version}}.nupkg --source https://api.nuget.org/v3/index.json --api-key $NUGET_API_KEY --skip-duplicate
env:
NUGET_API_KEY: ${{secrets.NUGET_API_KEY}}
docker:
runs-on: ubuntu-latest
name: 🐋 Build and Push Docker Image
needs: test
steps:
- name: checkout
uses: actions/checkout@v4
- name: Get version
uses: kzrnm/get-net-sdk-project-versions-action@v1
id: get-version
with:
proj-path: src/dotnet-test-rerun.csproj
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
context: src
tags: joaoopereira/dotnet-test-rerun:latest, joaoopereira/dotnet-test-rerun:${{steps.get-version.outputs.version}}