Skip to content

Feature/report #121

Feature/report

Feature/report #121

Workflow file for this run

name: CICD
on:
push:
branches:
- main
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 --collect:"XPlat Code Coverage" --settings VakilPors.Test/coverlet.runsettings --verbosity normal --no-build
working-directory: ./src/VakilPors
- name: Find first subfolder
id: subfolder
run: echo "subfolder=$(ls ./VakilPors.Test/TestResults | head -n 1)" >> $GITHUB_OUTPUT
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/${{ steps.subfolder.outputs.subfolder }}/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