ci: add codecov token #138
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
name: build | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
env: | |
DOTNET_NOLOGO: true | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 15 | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
fetch-depth: 2 | |
- uses: actions/[email protected] | |
with: | |
path: ~/.nuget/packages | |
# Look to see if there is a cache hit for the corresponding requirements file | |
# key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }} | |
# restore-keys: | | |
# ${{ runner.os }}-nuget | |
- name: restore | |
run: dotnet restore | |
- name: build | |
run: dotnet build --no-restore ./MimeMapping.sln | |
- name: test | |
run: dotnet test --no-build ./MimeMapping.sln | |
- name: Codecov | |
uses: codecov/[email protected] | |
with: | |
files: '**/TestResults/*/*.cobertura.xml' | |
token: ${{ secrets.CODECOV_TOKEN }} | |
build: | |
needs: [test] | |
runs-on: windows-latest | |
timeout-minutes: 15 | |
permissions: | |
packages: write | |
contents: write | |
env: | |
CONFIGURATION: Release | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
fetch-depth: 0 # needed so minver finds git tags https://github.com/actions/checkout/issues/172 | |
- uses: actions/[email protected] | |
with: | |
path: ~/.nuget/packages | |
# Look to see if there is a cache hit for the corresponding requirements file | |
# key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }} | |
# restore-keys: | | |
# ${{ runner.os }}-nuget | |
- name: restore | |
run: dotnet restore | |
- name: build | |
run: dotnet build --no-restore | |
- name: pack | |
run: dotnet pack -o bin | |
- uses: actions/[email protected] | |
with: | |
name: packages | |
path: bin/*.nupkg |