-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Github Actions - set working directory in step #66
Comments
@pixo-wnobrien hey, sorry for late response. could you read this #55, and try two options that have been explained here
please let me know if this has resolved your issue. |
I'm having a similar issue, with a monorepo containing a single Go module nested a few directories inside. I think the issue is similar to in @pixo-wnobrien's case, Setting |
hello gents, i have started to work on feature that will allow user to set source directory. this feature should allow use of this tool in monorepos. could you please test it out and give me insights? to test it you can use in ci:
locally:
|
@vladopajic tried with the commit provided, it still doesnt work after providing source-dir also
|
Same error here, have altered the full output to make it clearer (new lines my own):
In the above, the |
hello gents, not sure how do you actually want to setup you repositories. it would require me to see in the details your project setup to understand what is happening. please feel free to this example https://github.com/vladopajic/monorepo-covrage where coverage check is configured to work with monorepo. would something like this work for you? |
@vladopajic The in monorepo-covrage lacks the github-action setup. Please try to set github actions in this repo for both projects and you will see the problem that issue describes. jobs:
backend-unit-test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: proja
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- name: run tests
run: go test -v -cover -coverprofile=test.cover.out ./...
- name: check test coverage
# run go-test-coverage as a go command - this is a workaround I use today
# to make sure go-test-coverage is executed inside proja dir
run: go run github.com/vladopajic/go-test-coverage/v2 -c .testcoverage.yml
# ideal solution would be to pass a working-directory and go-test-coverage
# change the dir and execute the cover change there.
uses: vladopajic/go-test-coverage@v2
with:
config: .testcoverage.yml
working-directory: proja |
I have a repo with a couple different projects in it, and I would like to set up a workflow that tests all the projects on a PR. It would be great if I could set the working directory in the step like below:
I usually use golangci-lint in the same pipeline before I run my tests, and the Github Action for that works in this way
I've tried many different workarounds, but I'm having a hard time getting it to work in my repo with multiple projects without this feature. If there are any suggestions that would be greatly appreciated! I put my workflow file below for reference
I can configure the step to use the corresponding
cover.out
file, but since the step is not running in the directory that the tests were run in I get the following error:The text was updated successfully, but these errors were encountered: