Skip to content

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

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

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

Workflow file for this run

---
name: openshift-tests-plugin / test
on:
workflow_call: {}
push:
tags:
- '*'
pull_request:
branches:
- main
- release-*
env:
GO_VERSION: 1.22
STATIC_CHECK_VERSION: 2023.1.7
jobs:
go-static:
name: "go-staticcheck"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: WillAbides/[email protected]
with:
go-version: ${{ env.GO_VERSION }}
- name: Run static code analysis
uses: dominikh/[email protected]
with:
version: "${{ env.STATIC_CHECK_VERSION }}"
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: ${{ env.GO_VERSION }}
- name: Run go vet
working-directory: openshift-tests-plugin
run: |
go vet ./...
unit:
name: go-test
runs-on: ubuntu-latest
needs:
- go-static
- go-vet
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Run unit tests
working-directory: openshift-tests-plugin
run: |
go test ./...
build-binary:
runs-on: ubuntu-latest
needs:
- unit
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- 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: ${{ env.GO_VERSION }}
- 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