-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add scripts for testing and linting (#559)
* Add scripts for testing and linting * Use test scripts in GH actions (cherry picked from commit 2cd4fef) Co-authored-by: Rebecca Roberts <[email protected]>
- Loading branch information
1 parent
d871d81
commit 3da3885
Showing
5 changed files
with
69 additions
and
44 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: scripts | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- v[0-9]* | ||
pull_request: | ||
branches: | ||
- main | ||
- v[0-9]* | ||
|
||
jobs: | ||
unit-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: "src/go.mod" | ||
- run: ./scripts/subtests/unit-test | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: "src/go.mod" | ||
- run: ./scripts/subtests/lint |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
set -eux | ||
set -o pipefail | ||
|
||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
|
||
set +e | ||
golangci_lint_executable=$(which golangci-lint) | ||
set -e | ||
if [ -z "${golangci_lint_executable}" ] || [ ! -x "${golangci_lint_executable}" ]; then | ||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest | ||
fi | ||
|
||
pushd "${SCRIPT_DIR}/../../src" > /dev/null | ||
golangci-lint run ./... | ||
popd > /dev/null | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
set -eux | ||
set -o pipefail | ||
|
||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
|
||
pushd "${SCRIPT_DIR}/../../src" > /dev/null | ||
go run github.com/onsi/ginkgo/v2/ginkgo -r -p --randomize-all --randomize-suites --fail-on-pending --keep-going --race --trace | ||
popd > /dev/null | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
set -eux | ||
set -o pipefail | ||
|
||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
|
||
"${SCRIPT_DIR}/subtests/lint" | ||
"${SCRIPT_DIR}/subtests/unit-test" | ||
|