Skip to content
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

fix: Update testing and linting scripts #483

Merged
merged 2 commits into from
Apr 11, 2024
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
21 changes: 0 additions & 21 deletions .github/workflows/ruby.yml

This file was deleted.

22 changes: 9 additions & 13 deletions .github/workflows/go.yml → .github/workflows/scripts.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Go
name: scripts

on:
push:
Expand All @@ -11,25 +11,24 @@ on:
- v[0-9]*

jobs:
test:
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "src/go.mod"
- run: go run github.com/onsi/ginkgo/v2/ginkgo -r --randomize-all --randomize-suites --fail-on-pending --keep-going --race --trace
working-directory: src
- run: ./scripts/subtests/unit-test

vet:
spec-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- uses: ruby/setup-ruby@v1
with:
go-version-file: "src/go.mod"
- run: go vet $(go list ./... | grep -v internal/promql$)
working-directory: src
ruby-version: '2.7'
bundler-cache: true
- run: ./scripts/subtests/spec-test

lint:
runs-on: ubuntu-latest
Expand All @@ -38,7 +37,4 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version-file: "src/go.mod"
- uses: golangci/[email protected]
with:
args: --config .golangci.yml
working-directory: src
- run: ./scripts/subtests/lint
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
source 'https://rubygems.org'

ruby '~> 3.3'
ruby '~> 2.7'

group :development, :test do
gem 'bosh-template'
gem 'bosh-template', '2.2.1'
gem 'rspec'
gem 'rspec-its'
end
9 changes: 2 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GEM
remote: https://rubygems.org/
specs:
bosh-template (2.4.0)
bosh-template (2.2.1)
semi_semantic (~> 1.2.0)
diff-lcs (1.5.1)
rspec (3.13.0)
Expand All @@ -26,12 +26,7 @@ PLATFORMS
ruby

DEPENDENCIES
bosh-template
bosh-template (= 2.2.1)
rspec
rspec-its

RUBY VERSION
ruby 3.3.0p0

BUNDLED WITH
2.4.10
8 changes: 0 additions & 8 deletions scripts/deploy-bosh-lite

This file was deleted.

48 changes: 0 additions & 48 deletions scripts/operations/cf-auth-proxy.yml

This file was deleted.

18 changes: 18 additions & 0 deletions scripts/subtests/lint
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

11 changes: 11 additions & 0 deletions scripts/subtests/spec-test
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}/../.." > /dev/null
bundle exec rspec
popd > /dev/null

11 changes: 11 additions & 0 deletions scripts/subtests/unit-test
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

Loading
Loading