Skip to content

Commit

Permalink
actions: various fixes to initial GitHub Actions
Browse files Browse the repository at this point in the history
...that merged too early ;)

Signed-off-by: Jose A. Rivera <[email protected]>
  • Loading branch information
jarrpa committed Sep 16, 2022
1 parent c78fa54 commit 0cd4dbe
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 22 deletions.
43 changes: 29 additions & 14 deletions .github/workflows/ocs-operator-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,41 @@ jobs:
fetch-depth: 0

- name: Run shellcheck
run: make shellcheck
run: make shellcheck-test

golangci-lint:
name: golangci-lint
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go: ["1.17", "1.18"]
go: ["1.18","1.19"]
steps:
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
go-version-file: go.mod

- uses: actions/checkout@v3
with:
fetch-depth: 0

# TODO: Our code currently does not pass linting using Go 1.19, so
# avoiding it until we bump go.mod to 1.19 as well.
- uses: actions/setup-go@v3
with:
go-version-file: go.mod

- uses: golangci/golangci-lint-action@v3
with:
version: v1.49.0
args: -E gosec --timeout=6m

# The weird NO_FUTURE thing is a workaround suggested here:
# # https://github.com/golangci/golangci-lint-action/issues/119#issuecomment-981090648
args: "--out-${NO_FUTURE}format=colored-line-number --timeout=6m ./..."

go-test:
name: go-test unit tests
name: go test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go: ["1.17", "1.18"]
go: ["1.18", "1.19"]
steps:
- uses: actions/setup-go@v3
with:
Expand All @@ -69,8 +73,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go: ["1.17", "1.18"]
make-target: ["verify-deps", "verify-generated", "verify-latest-csv", "verify-operator-bundle", "verify-latest-deploy-yaml"]
go: ["1.18", "1.19"]
steps:
- uses: actions/setup-go@v3
with:
Expand All @@ -80,5 +83,17 @@ jobs:
with:
fetch-depth: 0

- name: Run ${{ matrix.make-target }} make target
run: make ${{ matrix.make-target }}
- name: Verify go dependencies
run: make verify-deps

- name: Verify generated code and configd
run: make verify-generated

- name: Verify CSV changes
run: make verify-latest-csv

- name: Verify bundle changes
run: make verify-operator-bundle

- name: Verify deployment YAML
run: make verify-latest-deploy-yaml
3 changes: 0 additions & 3 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@ run:
linters:
disable-all: true
enable:
- deadcode
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- structcheck
- unused
- varcheck
- gofmt
- revive
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ verify-latest-csv: gen-latest-csv
@echo "Verifying latest CSV"
hack/verify-latest-csv.sh

verify-operator-bundle:
verify-operator-bundle: operator-sdk
@echo "Verifying operator bundle"
hack/verify-operator-bundle.sh

Expand Down
2 changes: 1 addition & 1 deletion hack/golangci_lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ source hack/common.sh

mkdir -p ${OUTDIR_TOOLS}
LINT_BIN="${OUTDIR_TOOLS}/golangci-lint"
LINT_VER="1.47.3"
LINT_VER="1.49.0"

check_bin_exists() {
which "${LINT_BIN}" >/dev/null 2>&1 && [[ "$(${LINT_BIN} --version)" == *"${LINT_VER}"* ]]
Expand Down
5 changes: 2 additions & 3 deletions hack/verify-operator-bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

set -e

source hack/common.sh
source hack/ensure-operator-sdk.sh
source hack/docker-common.sh
source hack/operator-sdk-common.sh

./"${OPERATOR_SDK}" bundle validate "$(dirname $OCS_FINAL_DIR)" -b "$IMAGE_BUILD_CMD" --verbose
./"${OPERATOR_SDK}" bundle validate "$(dirname $OCS_FINAL_DIR)" --verbose

0 comments on commit 0cd4dbe

Please sign in to comment.