Skip to content

Bump codecov/codecov-action from 4.6.0 to 5.0.7 #2341

Bump codecov/codecov-action from 4.6.0 to 5.0.7

Bump codecov/codecov-action from 4.6.0 to 5.0.7 #2341

Workflow file for this run

name: commit
on:
workflow_dispatch: # Allow running on-demand
push:
branches: [main]
paths:
- ".github/workflows/commit.yml"
- "src/**"
- "scripts/**"
- "**.py"
- "whim-installer.iss"
- "Whim.sln"
- "Directory.Packages.props"
- ".csharpierrc"
- ".xamlstylerrc"
- ".ruff.toml"
- ".config/dotnet-tools.json"
pull_request:
paths:
- ".github/workflows/commit.yml"
- "src/**"
- "scripts/**"
- "**.py"
- "whim-installer.iss"
- "Whim.sln"
- "Directory.Packages.props"
- ".csharpierrc"
- ".xamlstylerrc"
- ".ruff.toml"
- ".config/dotnet-tools.json"
env:
# We install the packages to the D:\ drive to avoid the slow IO on the C:\ drive.
# Based on https://github.com/actions/setup-dotnet/issues/260#issuecomment-1790162905
NUGET_PACKAGES: D:\a\.nuget\packages
jobs:
commit:
strategy:
matrix:
configuration: [Debug, Release]
platform: [x64, arm64]
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ${{ env.NUGET_PACKAGES }}
key: ${{ matrix.platform }}-nuget-${{ hashFiles('Directory.Packages.props') }}
restore-keys: |
${{ matrix.platform }}-nuget-${{ hashFiles('Directory.Packages.props') }}
${{ matrix.platform }}-nuget-
- name: Restore dependencies
run: |
dotnet restore Whim.sln -p:Configuration=$env:Configuration
env:
Configuration: ${{ matrix.configuration }}
- name: Install dotnet tools
run: |
dotnet tool restore
- name: Check C# formatting
run: |
dotnet tool run dotnet-csharpier . --check
- name: Check XAML formatting
run: |
dotnet tool run xstyler --recursive --d . --passive --config ./.xamlstylerrc
# - name: Check analyzers
# run: |
# dotnet format analyzers Whim.sln --verify-no-changes --no-restore
- name: Check Python formatting
uses: astral-sh/ruff-action@v1
with:
args: format --check
- name: Lint Python code
uses: astral-sh/ruff-action@v1
with:
args: check
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Build
run: |
msbuild Whim.sln `
-p:Configuration=$env:Configuration `
-p:Platform=$env:Platform `
-p:BuildInParallel=true `
-maxCpuCount
env:
Configuration: ${{ matrix.configuration }}
Platform: ${{ matrix.platform }}
- name: Test
run: |
dotnet test Whim.sln --collect:"XPlat Code Coverage;Format=opencover"
- name: Upload coverage to Codecov
uses: codecov/[email protected]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}