forgejo-runner v13 does not interpolate ${{ runner.workspace }}
in working-directory: (or ignores the field entirely for docker
containers), so the container tried to chdir to '/_src' (literally)
which does not exist.
The image WORKDIR is /src, so clone directly into /src/_src and cd
into it at the start of each step. Adds an echo of the checkout
SHA + branch state for visibility in the log.
59 lines
1.5 KiB
YAML
59 lines
1.5 KiB
YAML
# 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: Dotnet build and test
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
logLevel:
|
|
description: 'Log level'
|
|
required: true
|
|
default: 'warning'
|
|
type: choice
|
|
options:
|
|
- info
|
|
- warning
|
|
- debug
|
|
tags:
|
|
description: 'Test scenario tags'
|
|
required: false
|
|
type: boolean
|
|
push:
|
|
branches: [ "main" ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
|
|
jobs:
|
|
log-the-inputs:
|
|
runs-on: debian-latest
|
|
steps:
|
|
- run: |
|
|
echo "Log level: $LEVEL"
|
|
echo "Tags: $TAGS"
|
|
echo "Environment: $ENVIRONMENT"
|
|
env:
|
|
LEVEL: ${{ inputs.logLevel }}
|
|
TAGS: ${{ inputs.tags }}
|
|
|
|
build:
|
|
|
|
runs-on: docker
|
|
|
|
steps:
|
|
- name: Clone yavsc
|
|
run: |
|
|
cd /src
|
|
git clone https://forgejo.pschneider.fr/notazof/yavsc.git _src
|
|
cd _src
|
|
if [ -n "${GITHUB_REF:-}" ]; then
|
|
git fetch --depth 1 origin "$GITHUB_REF"
|
|
git checkout FETCH_HEAD
|
|
fi
|
|
git submodule update --init --recursive --depth 1
|
|
echo "Checked out at $(git rev-parse HEAD) on $(git branch --show-current 2>/dev/null || echo detached HEAD)"
|
|
- name: Restore dependencies
|
|
run: cd /src/_src && dotnet restore
|
|
- name: Build
|
|
run: cd /src/_src && dotnet build --no-restore
|
|
- name: Test
|
|
run: cd /src/_src && dotnet test --no-build --verbosity normal
|