Skip to content

OPCT-289: migrating openshift-tests plugin implementation to Go #1

OPCT-289: migrating openshift-tests plugin implementation to Go

OPCT-289: migrating openshift-tests plugin implementation to Go #1

Workflow file for this run

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