Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions .github/workflows/go.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/scripts.yml
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: "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: "go.mod"
- run: ./scripts/subtests/lint
14 changes: 14 additions & 0 deletions scripts/subtests/lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

set -eux
set -o pipefail

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

if ! command -v golangci-lint &> /dev/null; then
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
fi

pushd "${SCRIPT_DIR}/../.." > /dev/null
golangci-lint run ./...
popd > /dev/null
17 changes: 17 additions & 0 deletions scripts/subtests/unit-test
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

set -eux
set -o pipefail

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

flags='-r --randomize-all --randomize-suites --fail-on-pending --keep-going --race --trace'
if [ "${CI:-false}" = 'false' ]; then
flags="${flags} -p"
fi
pushd "${SCRIPT_DIR}/../.." > /dev/null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run Ginkgo directly as in the other projects like for example in loggregator-agent-release:
go run github.com/onsi/ginkgo/v2/ginkgo $flags

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate why?

My idea was to fix this in loggregator-agent-release as well with PR cloudfoundry/loggregator-agent-release#717 . There I state:

Harmonize with lint script
This avoids recompiling ginkgo every time

if ! command -v ginkgo &> /dev/null; then
go install github.com/onsi/ginkgo/v2/ginkgo@latest
fi
ginkgo $flags
popd > /dev/null
13 changes: 6 additions & 7 deletions scripts/test
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/bin/bash

go get github.com/onsi/gomega
go get github.com/cloudfoundry/dropsonde/...
go get github.com/golang/protobuf
go get golang.org/x/net
go get golang.org/x/text
set -eux
set -o pipefail

set -ex
ginkgo -r -race
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

"${SCRIPT_DIR}/subtests/lint"
"${SCRIPT_DIR}/subtests/unit-test"