-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (53 loc) · 1.7 KB
/
cicd.yaml
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
name: CICD
on:
push:
branches:
- main
- features/cicd
pull_request:
branches:
- main
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
working-directory: ./src/VakilPors
- name: Build
run: dotnet build --no-restore
working-directory: ./src/VakilPors
- name: Test
run: dotnet test -p:CollectCoverage=true -p:CoverletOutput=TestResults/ -p:CoverletOutputFormat=opencover --no-build --verbosity normal VakilPors.Test/
working-directory: ./src/VakilPors
- name: Create Test Coverage Badge
uses: simon-k/dotnet-code-coverage-badge@v1.0.0
id: create_coverage_badge
with:
label: Unit Test Coverage
color: brightgreen
path: ./src/VakilPors/VakilPors.Test/TestResults/coverage.opencover.xml
gist-filename: code-coverage.json
gist-id: 20d8309ce4ac8005e22df30d985c6883
gist-auth-token: ${{ secrets.GIST_AUTH_TOKEN }}
- name: Print code coverage
run: echo "Code coverage percentage ${{steps.create_coverage_badge.outputs.percentage}}%"
cd:
needs: ci
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18"
- name: update-liara
env:
LIARA_TOKEN: ${{ secrets.LIARA_API_TOKEN }}
run: |
npm i -g @liara/cli@5
liara deploy --api-token="$LIARA_TOKEN" --detach