Skip to content

CI

CI #89

Workflow file for this run

name: CI
on:
push:
schedule:
- cron: '1 0 * * 1' # Mondays at 00:01
env:
DOTNET_VERSION: 8.x
BOT_NAME: TeenyLynx
DOTNET_CLI_TELEMETRY_OPTOUT: 1
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
include:
- os: ubuntu-latest
runtime-identifier: linux-x64
- os: windows-latest
runtime-identifier: win-x64
- os: macOS-latest
runtime-identifier: osx-x64
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v3.x
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Nuget cache
uses: actions/cache@v3
with:
path:
~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Build
run: dotnet build -c Release /p:UCI=true
- name: Test
run: dotnet test -c Release --no-build --collect:"XPlat Code Coverage" -v normal
- name: Publish CLI
run: dotnet publish TeenyLynx.UCI/TeenyLynx.UCI.csproj -c Release --runtime ${{ matrix.runtime-identifier }} --self-contained /p:Optimized=true /p:DeterministicBuild=true /p:UCI=true -o artifacts/${{ matrix.runtime-identifier }}
- name: Upload TeenyLynx-${{ env.GITHUB_REF_SLUG }}-${{ github.run_number }}-${{ matrix.runtime-identifier }} artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.BOT_NAME }}-${{ env.GITHUB_REF_SLUG }}-${{ github.run_number }}-${{ matrix.runtime-identifier }}
path: |
artifacts/${{ matrix.runtime-identifier }}/
!artifacts/${{ matrix.runtime-identifier }}/Chess-Challenge.pdb
!artifacts/**/*.runtimeconfig.json
!artifacts/**/src
!artifacts/**/resources
if-no-files-found: error