Skip to content

build(deps): update dependency dotnet-sdk to v9.0.102 (#41) #149

build(deps): update dependency dotnet-sdk to v9.0.102 (#41)

build(deps): update dependency dotnet-sdk to v9.0.102 (#41) #149

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
permissions:
contents: read
jobs:
build:
strategy:
matrix:
os: [ linux, osx, win ]
arch: [ x64, arm64 ]
include:
- os: linux
image: ubuntu-latest
- os: osx
image: macos-latest
- os: win
image: windows-latest
exclude:
- os: win
arch: arm64
- os: linux
arch: arm64
- os: osx
arch: x64
runs-on: ${{ matrix.image }}
defaults:
run:
shell: bash
steps:
- name: 🛡️ Harden Runner
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
aka.ms:443
api.codecov.io:443
api.nuget.org:443
auth.docker.io:443
builds.dotnet.microsoft.com:443
ci.dot.net:443
cli.codecov.io:443
dotnetbuilds.azureedge.net:443
dotnetcli.azureedge.net:443
github.com:443
ingest.codecov.io:443
keybase.io:443
objects.githubusercontent.com:443
storage.googleapis.com:443
- name: 🛒 Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: 🧰 Setup .NET
uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # v4.2.0
with:
global-json-file: global.json
- name: 🗃️ Setup NuGet cache
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: ${{ runner.os }}-nuget-
- name: 📥 Restore dependencies
run: dotnet restore --locked-mode
- name: 🏗️ Build
run: dotnet build --no-restore
- name: ✅ Test
run: dotnet test --no-build --verbosity normal -p:CollectCoverage=true -p:CoverletOutputFormat=opencover
- name: ☂️ Upload coverage reports to Codecov
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: ✅ Test Publish
run: |
dotnet publish --no-restore -r ${{ matrix.os }}-${{ matrix.arch }} -c Debug
7z a -tzip -mx9 flowpair-${{ matrix.os }}-${{ matrix.arch }}.zip $PWD/publish/*
if: (matrix.os == 'linux' && matrix.arch == 'x64') || (matrix.os == 'osx' && matrix.arch == 'arm64')