Skip to content

Enable package for gh actions ci. #17

Enable package for gh actions ci.

Enable package for gh actions ci. #17

name: NUnitConsoleAndEngine.CI
on:
push:
branches:
- main
paths-ignore:
- "*.txt"
- "*.md"
pull_request:
branches-ignore:
- "azure-*"
paths-ignore:
- "*.txt"
- "*.md"
env:
DOTNET_NOLOGO: true # Disable the .NET logo
DOTNET_CLI_TELEMETRY_OPTOUT: true # Disable sending .NET CLI telemetry
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
testRunName: Windows
# - os: ubuntu-latest
# testRunName: Linux
# - os: macos-14
# testRunName: Linux
fail-fast: false
env:
MYGET_API_KEY: ${{ secrets.MYGET_API_KEY }}
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }}
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_ACCESS_TOKEN }}
steps:
- name: ⤵️ Checkout Source
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 🛠️ Setup .NET
uses: actions/setup-dotnet@v4
with:
# global-json-file: global.json
dotnet-version: |
3.1.x
6.0.x
8.0.100
- name: 🔧 Install dotnet tools
run: dotnet tool restore
- name: 🍰 Run cake
shell: pwsh
# If you need to get more verbose logging, add the following to the dotnet-cake above: --verbosity=diagnostic
run: dotnet cake --target=Package --test-run-name=${{ matrix.testRunName }} --configuration=Release
- name: 🪵 Upload build logs
if: always()
uses: actions/upload-artifact@v4
with:
name: NUnitConsoleLogs
# This path is defined in build-settings.cake
path: "build-results/*.binlog"
# if-no-files-found: error
# Wait with this until package errors (tests following packaging) are all fixed
# - name: 📦 Package
# run: dotnet tool run dotnet-cake --target=Package
# - name: 💾 Upload build artifacts
# uses: actions/upload-artifact@v4
# with:
# name: Package
# path: package
- name: 💾 Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: "Test results (${{ matrix.testRunName }})"
path: test-results