Add unit test initialization logic #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, reopened, synchronize] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
env: | |
version_suffix_args: ${{ format('/p:VersionSuffix="artifact.{0}"', github.run_number) }} | |
steps: | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '9.x' | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Restore dependencies | |
run: dotnet restore | |
source/Lambda.sln | |
- name: Build | |
run: dotnet build | |
source/Lambda.sln | |
--configuration Release | |
- name: Pack | |
run: dotnet pack | |
source/Lambda.sln | |
--configuration Release | |
--output "${{github.workspace}}/artifacts/packages" | |
${{ env.version_suffix_args}} | |
- name: Run unit tests | |
run: dotnet test | |
source/Lambda.sln | |
--configuration Release | |
--filter="TestCategory!=Manual" | |
--logger "trx;LogFilePrefix=main" | |
--results-directory ${{github.workspace}}/artifacts/test-results | |
${{ env.version_suffix_args}} | |
env: | |
KAGI_API_KEY: ${{ secrets.LAMBDA_API_KEY }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: build-artifacts | |
path: ${{github.workspace}}/artifacts |