mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-10 20:05:55 +02:00
CI: ensure tests don't alter the repository
This commit is contained in:
parent
627eb352f1
commit
880a85f404
1 changed files with 10 additions and 0 deletions
10
.github/workflows/go-tests.yml
vendored
10
.github/workflows/go-tests.yml
vendored
|
@ -181,7 +181,17 @@ jobs:
|
|||
- name: Unit tests
|
||||
run: |
|
||||
go install gotest.tools/gotestsum@v1.12.1
|
||||
# make the repo read-only, with the exception of coverage output
|
||||
touch coverage.out
|
||||
chmod -R a-w .
|
||||
chmod u+w coverage.out
|
||||
make testcover
|
||||
# ignore/discard changes to codecov.yml
|
||||
if [[ $(git status --porcelain -- . ":(exclude).github/codecov.yml" ]]; then
|
||||
echo "Error: Unit tests should not create or alter files inside the repository. Please use the appropriate testing helpers or otherwise temporary locations."
|
||||
git diff --name-only
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# check if some component stubs are missing
|
||||
- name: "Build profile: minimal"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue