Skip to content

Disable broken code

Disable broken code #3

name: 'Build application'
on:
push:
branches:
- '**'
paths:
- '.github/workflows/**'
- 'src/**'
- 'test/**'
- '*.sln'
- '*.slnf'
- '*.config'
- '*.props'
- '*.targets'
pull_request:
branches:
- '**'
paths:
- '.github/workflows/**'
- 'src/**'
- 'test/**'
- '*.sln'
- '*.slnf'
- '*.config'
- '*.props'
- '*.targets'
defaults:
run:
shell: pwsh
jobs:
build-common:
name: 'Build common'
strategy:
matrix:
system:
- windows-2022
- ubuntu-22.04
- macos-14
config:
- Debug
- Release
runs-on: ${{ matrix.system }}
env:
Solution: GeneoGraph.Common.slnf
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: Cache packages
uses: actions/cache@v4
with:
key: Application-NuGet-${{ runner.os }}-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
Application-NuGet-${{ runner.os }}-${{ hashFiles('**/packages.lock.json') }}
Application-NuGet-${{ runner.os }}-
Application-NuGet-
path: |
~/.nuget/packages
- name: Restore packages
run: |
dotnet restore $env:Solution
- name: Build application
run: |
dotnet build $env:Solution `
--configuration ${{ matrix.config }} `
--no-restore
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: application-${{ matrix.system }}-${{ matrix.config }}-${{ github.sha }}
path: bin/${{ matrix.config }}/
test-common:
name: 'Test common'
needs:
- build-common
strategy:
matrix:
system:
- windows-2022
- ubuntu-22.04
- macos-14
config:
- Debug
- Release
runs-on: ${{ matrix.system }}
env:
Solution: GeneoGraph.Common.slnf
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: Cache packages
uses: actions/cache@v4
with:
key: Application-NuGet-${{ runner.os }}-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
Application-NuGet-${{ runner.os }}-${{ hashFiles('**/packages.lock.json') }}
Application-NuGet-${{ runner.os }}-
Application-NuGet-
path: |
~/.nuget/packages
- name: Restore packages
run: |
dotnet restore $env:Solution
- name: Run tests
run: |
dotnet test $env:Solution `
--no-restore
publish-windows:
name: 'Publish Windows'
needs:
- test-common
strategy:
matrix:
system:
- windows-2022
framework:
- net6.0-windows
- net7.0-windows
- net8.0-windows
runtime:
- win-x86
- win-x64
config:
- Release
runs-on: ${{ matrix.system }}
env:
Project: src\ImeSense.GeneoGraph.Windows\ImeSense.GeneoGraph.Windows.csproj
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Cache packages
uses: actions/cache@v4
with:
key: Application-NuGet-${{ runner.os }}-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
Application-NuGet-${{ runner.os }}-${{ hashFiles('**/packages.lock.json') }}
Application-NuGet-${{ runner.os }}-
Application-NuGet-
path: |
~/.nuget/packages
- name: Restore packages
run: |
dotnet restore $env:Project
- name: Publish application
run: |
dotnet publish $env:Project `
--framework ${{ matrix.framework }} `
--runtime ${{ matrix.runtime }} `
--configuration ${{ matrix.config }} `
--self-contained true `
-p:PublishSingleFile=true `
-p:PublishReadyToRun=true `
-p:IncludeAllContentForSelfExtract=true `
-p:EnableCompressionInSingleFile=true `
-p:DebugSymbols=false `
-p:DebugType=None
- name: Upload application
uses: actions/upload-artifact@v4
with:
name: application-${{ matrix.framework }}-${{ matrix.runtime }}-${{ matrix.config }}-${{ github.sha }}
path: bin/${{ matrix.config }}/${{ matrix.framework }}/${{ matrix.runtime }}/publish/
publish-linux:
name: 'Publish Linux'
needs:
- test-common
strategy:
matrix:
system:
- ubuntu-22.04
framework:
- net6.0
- net7.0
- net8.0
runtime:
- linux-x64
config:
- Release
runs-on: ${{ matrix.system }}
env:
Project: src/ImeSense.GeneoGraph.Linux/ImeSense.GeneoGraph.Linux.csproj
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Cache packages
uses: actions/cache@v4
with:
key: Application-NuGet-${{ runner.os }}-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
Application-NuGet-${{ runner.os }}-${{ hashFiles('**/packages.lock.json') }}
Application-NuGet-${{ runner.os }}-
Application-NuGet-
path: |
~/.nuget/packages
- name: Restore packages
run: |
dotnet restore $env:Project
- name: Publish application
run: |
dotnet publish $env:Project `
--framework ${{ matrix.framework }} `
--runtime ${{ matrix.runtime }} `
--configuration ${{ matrix.config }} `
--self-contained true `
-p:PublishSingleFile=true `
-p:PublishReadyToRun=true `
-p:IncludeAllContentForSelfExtract=true `
-p:EnableCompressionInSingleFile=true `
-p:DebugSymbols=false `
-p:DebugType=None
- name: Upload application
uses: actions/upload-artifact@v4
with:
name: application-${{ matrix.framework }}-${{ matrix.runtime }}-${{ matrix.config }}-${{ github.sha }}
path: bin/${{ matrix.config }}/${{ matrix.framework }}/${{ matrix.runtime }}/publish/
publish-macos:
name: 'Publish macOS'
needs:
- test-common
if: false
strategy:
matrix:
system:
- macos-14
framework:
- net7.0-macos
- net8.0-macos
runtime:
- osx-x64
- osx-arm64
config:
- Release
exclude:
- system: macos-14
framework: net8.0-macos
runtime: osx-x64
config: Release
- system: macos-14
framework: net8.0-macos
runtime: osx-arm64
config: Release
runs-on: ${{ matrix.system }}
env:
Project: src/ImeSense.GeneoGraph.macOS/ImeSense.GeneoGraph.macOS.csproj
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Cache workloads
uses: actions/cache@v4
with:
key: GeneoGraph-Workloads-${{ runner.os }}-
restore-keys: |
GeneoGraph-Workloads-${{ runner.os }}-
path: |
~/.dotnet/packs/**/*.nupkg
- name: Install workloads
run: |
dotnet workload install `
macos
- name: Cache packages
uses: actions/cache@v4
with:
key: Application-NuGet-${{ runner.os }}-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
Application-NuGet-${{ runner.os }}-${{ hashFiles('**/packages.lock.json') }}
Application-NuGet-${{ runner.os }}-
Application-NuGet-
path: |
~/.nuget/packages
- name: Restore packages
run: |
dotnet restore $env:Project
- name: Publish application
run: |
dotnet publish $env:Project `
--framework ${{ matrix.framework }} `
--runtime ${{ matrix.runtime }} `
--configuration ${{ matrix.config }} `
--self-contained true `
-p:PublishReadyToRun=true `
-p:CreatePackage=false `
-p:DebugSymbols=false `
-p:DebugType=None
- name: Upload application
uses: actions/upload-artifact@v4
with:
name: application-${{ matrix.framework }}-${{ matrix.runtime }}-${{ matrix.config }}-${{ github.sha }}
path: bin/${{ matrix.config }}/${{ matrix.framework }}/${{ matrix.runtime }}/publish/