-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci/gha: intro opct workfflow w/ unified tests, isolate release
- Loading branch information
Showing
4 changed files
with
187 additions
and
61 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,176 @@ | ||
name: OPCT/openshift-tests-plugin | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
pull_request: | ||
branches: | ||
- main | ||
- release-* | ||
|
||
jobs: | ||
shell-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Shellcheck - must-gather-monitoring plugin - entrypoint | ||
uses: azohra/shell-linter@latest | ||
with: | ||
path: './build.*' | ||
|
||
- name: Shellcheck - openshift-tests-plugin | ||
uses: azohra/shell-linter@latest | ||
with: | ||
path: './openshift-tests-plugin/plugin/*.sh' | ||
|
||
- name: Shellcheck - must-gather-monitoring plugin - entrypoint | ||
uses: azohra/shell-linter@latest | ||
with: | ||
path: './must-gather-monitoring/runner_plugin' | ||
|
||
- name: Shellcheck - must-gather-monitoring plugin - collection scripts | ||
uses: azohra/shell-linter@latest | ||
with: | ||
path: './must-gather-monitoring/collection-scripts/*' | ||
|
||
- name: Shellcheck - hack | ||
uses: azohra/shell-linter@latest | ||
with: | ||
path: "hack/*.sh" | ||
|
||
yaml-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install yamllint | ||
run: pip install yamllint | ||
|
||
- name: Lint YAML files | ||
run: | | ||
echo ">> Running YAML lint on data/templates/plugins/" | ||
yamllint .github/workflows/*.yaml | ||
go-lint: | ||
name: go-lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.22' | ||
cache: false | ||
|
||
# https://github.com/golangci/golangci-lint-action | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v6.0.1 | ||
args: --timeout=10m | ||
working-directory: openshift-tests-plugin | ||
|
||
go-static: | ||
name: "go-staticcheck" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: WillAbides/[email protected] | ||
with: | ||
go-version: '1.22' | ||
- name: Run static code analysis | ||
uses: dominikh/[email protected] | ||
with: | ||
version: "2023.1.7" | ||
install-go: false | ||
working-directory: openshift-tests-plugin | ||
|
||
go-vet: | ||
name: "go-vet" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.22' | ||
- name: Run go vet | ||
run: | | ||
go vet ./... | ||
go-test: | ||
name: go-test | ||
runs-on: ubuntu-latest | ||
needs: | ||
- go-lint | ||
- go-static | ||
- go-vet | ||
- shell-lint | ||
- yaml-lint | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.22' | ||
|
||
- name: Run unit tests | ||
working-directory: openshift-tests-plugin | ||
run: | | ||
go test ./... | ||
build-binary: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- go-test | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.22 | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y make git -y | ||
- name: Build Binary (OS=linux/amd64) | ||
env: | ||
OS_ARCH: linux/amd64 | ||
working-directory: openshift-tests-plugin | ||
run: | | ||
make build | ||
- name: Archive artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: openshift-tests-plugin | ||
path: openshift-tests-plugin/openshift-tests-plugin | ||
|
||
# build-image: | ||
# runs-on: ubuntu-latest | ||
# needs: | ||
# - build-binary | ||
# steps: | ||
# - name: Checkout | ||
# uses: actions/checkout@v3 | ||
|
||
# - name: Set up Go | ||
# uses: actions/setup-go@v4 | ||
# with: | ||
# go-version: 1.22 | ||
|
||
# - name: Install dependencies | ||
# run: | | ||
# sudo apt-get update | ||
# sudo apt-get install -y make git -y | ||
|
||
# - name: Build Binary (OS=linux/amd64) | ||
# env: | ||
# OS_ARCH: linux/amd64 | ||
# run: | | ||
# make build COMMAND=build PLATFORMS=linux/amd64 | ||
|
||
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
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