I’m new to GitHub actions and have been playing around this morning in order to learn, I’m a .Net developer.
I have a small repo with multiple distinct folders for various distinct unrelated projects. I can get the projects to build when I push but the test step is failing and in a confusing way.
First despite the action saying --no-build it seems to try and build the test project anyway which confused the hell out of me, secondly it cannot run the tests themselves, that fails with:
The argument /home/runner/work/Steadsoft/Steadsoft/Nep.Scheduling/Nep.Scheduling.Tests/bin/Debug/net5.0/Nep.Scheduling.Tests.dll is invalid. Please use the /help option to check the list of valid arguments.
The repo is named
Steadsoft (its private but I can perhaps setup a fresh public one if this is helpful).
Here’s the yaml
name: .NET on: push: branches: [ master ] pull_request: branches: [ master ] jobs: build: runs-on: ubuntu-latest defaults: run: working-directory: Nep.Scheduling steps: - uses: actions/checkout@v2 - name: Setup .NET uses: actions/setup-dotnet@v1 with: dotnet-version: 5.0.x - name: Restore dependencies run: dotnet restore Nep.Scheduling/Nep.Scheduling.csproj - name: Build run: dotnet build --no-restore Nep.Scheduling/Nep.Scheduling.csproj - name: Test run: dotnet test --no-build --verbosity detailed Nep.Scheduling.Tests/Nep.Scheduling.Tests.csproj working-directory: Nep.Scheduling
I’m also very confused about why the repo name appears twice in some of the paths that get printed as the action executes.
The repo contains a folder
Nep.Scheduling (this is one of the numerous distinct things in the repo).
The code (a library) is in sub-folder
Nep.Scheduling and the test project is in sub-folder
Nep.Scheduling.Tests (and each of these are in the the parent folder
Nep.Scheduling as you can see).
The project builds fine locally and I can run the tests fine locally too (VS 2019) one of the tests has been intentionally broken by me just so I can see how it fails in GitHub but it can’t even run the tests!
Does the yml assume the working folder is always the repo root? (that is to say, are relative paths always treated as being relative to the repo folder itself).
Should I uses slash or backslash in pathnames?
Anyone have any ideas?
I just put all this into a small public repo that shows the problem.