Skip to content

DNM: Release v0.5 tracking #508

DNM: Release v0.5 tracking

DNM: Release v0.5 tracking #508

Workflow file for this run

---
name: "OPCT"
on:
pull_request:
branches:
- main
- release-*
push:
tags:
- '*'
env:
GO_VERSION: 1.22
GOLANGCI_LINT_VERSION: v1.59
STATIC_CHECK_VERSION: 2023.1.7
jobs:
go-lint:
name: go-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
# https://github.com/golangci/golangci-lint-action
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}
args: --timeout=10m
go-static:
name: "go-staticcheck"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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
go-test:
name: go-test
runs-on: ubuntu-latest
needs:
- go-lint
- go-static
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Run unit tests
run: make test
go-vet:
name: "go-vet"
runs-on: ubuntu-latest
needs:
- go-lint
- go-static
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Run go vet
run: make vet
build:
name: "build-artifact"
runs-on: ubuntu-latest
needs:
- go-test
- go-vet
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y make git -y
- name: Build (OS=linux-amd64)
env:
OS_ARCH: linux-amd64
run: |
make clean
make linux-amd64-container
make build-${OS_ARCH}
- name: Save artifacts (OS=linux-amd64)
uses: actions/upload-artifact@v4
with:
name: opct-linux-amd64
path: |
build/opct-*
- name: Build (OS=darwin-arm64)
env:
OS_ARCH: darwin-arm64
run: |
make clean
make build-${OS_ARCH}
- name: Save artifacts (OS=darwin-arm64)
uses: actions/upload-artifact@v4
with:
name: opct-darwin-arm64
path: |
build/opct-*
e2e-cmd_report:
name: "e2e-cmd_report"
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: opct-linux-amd64
path: /tmp/build/
- name: Running report
env:
BUCKET: openshift-provider-certification
REGION: us-west-2
OPCT_MODE: v0.4.0/default
EXEC_MODE: default
ARTIFACT: 4.15.0-20240228-HighlyAvailable-vsphere-None.tar.gz
OPCT: /tmp/build/opct-linux-amd64
run: |
URI=${OPCT_MODE}/${ARTIFACT}
URL=https://${BUCKET}.s3.${REGION}.amazonaws.com/${URI}
echo "> Downloading sample artifact: ${URL}"
wget -qO /tmp/result.tar.gz "${URL}"
echo "> Setting run permissions to OPCT:"
chmod u+x ${OPCT}
echo "> Running OPCT report:"
${OPCT} report /tmp/result.tar.gz
e2e-cmd_adm-parse-etcd-logs:
name: "e2e-cmd_adm-parse-etcd-logs"
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: opct-linux-amd64
path: /tmp/build/
- name: Preparing testdata
env:
BUCKET: openshift-provider-certification
REGION: us-west-2
VERSION: "testdata/must-gather-etcd-logs.tar.gz"
CUSTOM_BUILD_PATH: /tmp/build/opct-linux-amd64
LOCAL_TEST_DATA: /tmp/must-gather.tar.gz
LOCAL_TEST_DATA_DIR: /tmp/must-gather
run: |
URL=https://${BUCKET}.s3.${REGION}.amazonaws.com
echo "> Downloading sample artifact: ${URL}/${VERSION}"
wget -qO ${LOCAL_TEST_DATA} "${URL}/${VERSION}"
echo "> Setting run permissions to OPCT:"
chmod u+x ${CUSTOM_BUILD_PATH}
echo "> Extracting testdata:"
mkdir ${LOCAL_TEST_DATA_DIR}
tar xfz ${LOCAL_TEST_DATA} -C ${LOCAL_TEST_DATA_DIR}
- name: "e2e stdin reader: cat <etcd pod logs> | opct adm parse-etcd-logs"
env:
CUSTOM_BUILD_PATH: /tmp/build/opct-linux-amd64
TEST_DATA_DIR: /tmp/must-gather
NS_PATH_ETCD: namespaces/openshift-etcd/pods
LOG_PATH: etcd/etcd/logs
run: |
cat ${TEST_DATA_DIR}/*/*/${NS_PATH_ETCD}/*/${LOG_PATH}/*.log | \
${CUSTOM_BUILD_PATH} adm parse-etcd-logs
- name: "e2e must-gather dir: opct adm parse-etcd-logs <must-gather-dir>"
env:
CUSTOM_BUILD_PATH: /tmp/build/opct-linux-amd64
TEST_DATA_DIR: /tmp/must-gather
run: |
${CUSTOM_BUILD_PATH} adm parse-etcd-logs ${TEST_DATA_DIR}
- name: |
e2e aggregate by hour: opct adm parse-etcd-logs
--aggregator hour <must-gather-dir>
env:
OPCT: /tmp/build/opct-linux-amd64
TEST_DATA_DIR: /tmp/must-gather
run: |
${OPCT} adm parse-etcd-logs --aggregator hour ${TEST_DATA_DIR}
- name: |
e2e ignore error counters: opct adm parse-etcd-logs
--skip-error-counter=true <must-gather-dir>
env:
OPCT: /tmp/build/opct-linux-amd64
TEST_DATA_DIR: /tmp/must-gather
run: |
${OPCT} adm parse-etcd-logs \
--skip-error-counter=true ${TEST_DATA_DIR}
e2e-cmd_adm-parse-metrics:
name: "e2e-cmd_adm-parse-metrics"
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: opct-linux-amd64
path: /tmp/build/
- name: Preparing testdata
env:
BUCKET: openshift-provider-certification
REGION: us-west-2
PREFIX: testdata/ci-external-aws-ccm_
VERSION: 1757495441294888960-artifacts_must-gather-metrics.tar.xz
CUSTOM_BUILD_PATH: /tmp/build/opct-linux-amd64
LOCAL_TEST_DATA: /tmp/opct-metrics.tar.xz
run: |
DATA_VERSION=${PREFIX}${VERSION}
URL=https://${BUCKET}.s3.${REGION}.amazonaws.com
echo "> Downloading sample artifact: ${URL}/${DATA_VERSION}"
wget -qO ${LOCAL_TEST_DATA} "${URL}/${DATA_VERSION}"
echo "> Setting exec permissions to OPCT:"
chmod u+x ${CUSTOM_BUILD_PATH}
- name: "e2e parse metrics: opct adm parse-etcd-logs <must-gather-dir>"
env:
CUSTOM_BUILD_PATH: /tmp/build/opct-linux-amd64
LOCAL_TEST_DATA: /tmp/opct-metrics.tar.xz
run: |
${CUSTOM_BUILD_PATH} adm parse-metrics \
--input ${LOCAL_TEST_DATA} --output /tmp/metrics
tree /tmp/metrics
e2e-cmd_adm-baseline:
name: "e2e-cmd_adm-baseline"
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: opct-linux-amd64
path: /tmp/build/
- name: Preparing testdata
env:
OPCT: /tmp/build/opct-linux-amd64
run: |
echo "> Setting exec permissions to OPCT:"
chmod u+x ${OPCT}
- name: "e2e adm baseline: opct adm baseline (list|get)"
env:
OPCT: /tmp/build/opct-linux-amd64
run: |
echo -e "\n\t#>> List latest baseline results"
${OPCT} adm baseline list
echo -e "\n\t#>> List all baseline results"
${OPCT} adm baseline list --all
echo -e "\n\t#>> Retrieve a baseline result by name"
${OPCT} adm baseline get --name 4.16_None_latest --dump
echo -e "\n\t#>> Retrieve a baseline result by release and platform"
${OPCT} adm baseline get --release 4.15 --platform None