Skip to content

Commit

Permalink
fix: Update testing and linting scripts
Browse files Browse the repository at this point in the history
- Removes old, unused ops files and bosh-lite scripts.
- Simplifies and gets working the testing and linting scripts.
- Updates GH actions to use the scripts.

Signed-off-by: Rebecca Roberts <rebecca.roberts@broadcom.com>
  • Loading branch information
ctlong authored and rroberts2222 committed Apr 11, 2024
1 parent 0234424 commit 5a59fd0
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 348 deletions.
44 changes: 0 additions & 44 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: "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
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/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

0 comments on commit 5a59fd0

Please sign in to comment.