Dev ops #17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# main ci workflow is to ensure the codebase builds. | |
# all unit tests must pass for the workflow to complete successfully. | |
name: main-ci | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
schedule: | |
- cron: "0 7 * * *" | |
workflow_dispatch: | |
permissions: | |
contents: read | |
env: | |
DOTNET_VERSION: '8.0' | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup environment | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Install coverlet | |
run: dotnet tool install --global coverlet.console | |
- name: Build | |
run: dotnet build | |
- name: Test | |
run: dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover | |
- name: Check if coverage file exists | |
run: | | |
if (Test-Path .\coverage.opencover.xml) { | |
Write-Host "Coverage file exists." | |
} else { | |
Write-Host "Coverage file does not exist." | |
} | |
shell: pwsh | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |