Skip to content

tools: remove no-op dotnet tool restore from build-dotnet action #3

tools: remove no-op dotnet tool restore from build-dotnet action

tools: remove no-op dotnet tool restore from build-dotnet action #3

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 Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
name: Build and test on all supported platforms.
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
publish:
name: Publish CI/CD snapshot
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install EF Core Tools
# https://stackoverflow.com/questions/59234655/apply-ef-migrations-in-github-workflow
run: dotnet tool install --global dotnet-ef
- name: Run build script
# https://stackoverflow.com/questions/58061430/how-to-call-powershell-script-with-github-actions-workflow
# https://stackoverflow.com/questions/58886293/getting-current-branch-and-commit-hash-in-github-action
shell: pwsh
run: |
$VersionDate = Get-Date -Format "yyyyMMdd-HHmm"
$VersionHash = git rev-parse --short "$GITHUB_SHA";
& ./Resources/build-prod.ps1 -VersionSuffix "-ci-$VersionDate-$VersionHash"