Skip to content

Add custom catalogsource #1608

Add custom catalogsource

Add custom catalogsource #1608

Workflow file for this run

---
name: Test Incoming Changes
'on':
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
env:
REGISTRY: quay.io
CERTSUITE_IMAGE_NAME: redhat-best-practices-for-k8s/certsuite
CERTSUITE_IMAGE_TAG: unstable
CERTSUITE_CONFIG_DIR: /tmp/certsuite/config
CERTSUITE_OUTPUT_DIR: /tmp/certsuite/output
TERM: xterm-color
SMOKE_TESTS_LOG_LEVEL: debug
SMOKE_TESTS_LABELS_FILTER: all
jobs:
linters:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: hadolint/[email protected]
with:
dockerfile: "Dockerfile*"
recursive: true
- uses: nosborn/[email protected]
with:
files: .
- uses: ludeeus/action-shellcheck@master
env:
SHELLCHECK_OPTS: --external-sources
with:
ignore_names: mo
- uses: mfinelli/setup-shfmt@v3
- run: shfmt -d scripts/*.sh
# - uses: crate-ci/typos@master # Temporarily disabled
- uses: ibiqlik/action-yamllint@v3
with:
config_data: |
extends: default
rules:
line-length:
level: warning
trailing-spaces:
level: warning
brackets:
level: warning
empty-lines:
level: warning
braces:
level: warning
smoke-tests:
name: Run Smoke Tests
runs-on: ubuntu-22.04
env:
SHELL: /bin/bash
KUBECONFIG: '/home/runner/.kube/config'
PFLT_DOCKERCONFIG: '/home/runner/.docker/config'
steps:
# Restart docker using /mnt/docker-storage (sdb) instead of /var/lib/docker (sda).
# This step needs to be done right after the partner repo's bootstrap scripts, as they
# overwrite the docker's daemon.json.
- name: Create docker/daemon.json if it does not exist
run: |
if [ ! -f /etc/docker/daemon.json ]; then
echo '{}' | sudo tee /etc/docker/daemon.json
fi
- name: Make docker to use /mnt (sdb) for storage
run: |
df -h
lsblk
sudo mkdir /mnt/docker-storage
sudo jq '. +={"data-root" : "/mnt/docker-storage"}' < /etc/docker/daemon.json > /tmp/docker-daemon.json
sudo cp /tmp/docker-daemon.json /etc/docker/daemon.json
cat /etc/docker/daemon.json
sudo systemctl restart docker
sudo ls -la /mnt/docker-storage
- name: Set up Go 1.23
uses: actions/setup-go@v5
with:
go-version: 1.23.2
- name: Disable default go problem matcher
run: echo "::remove-matcher owner=go::"
- name: Write temporary docker file
run: |
mkdir -p /home/runner/.docker
touch ${PFLT_DOCKERCONFIG}
echo '{ "auths": {} }' >> ${PFLT_DOCKERCONFIG}
- name: Check out `certsuite-sample-workload`
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
- name: Start the k8s cluster
uses: ./.github/actions/start-k8s-cluster
- name: Create `local-test-infra` OpenShift resources
uses: ./.github/actions/create-local-test-infra-resources
- name: Check out `certsuite`
uses: actions/checkout@v4
with:
repository: redhat-best-practices-for-k8s/certsuite
path: certsuite
- name: Create required Certsuite config files and directories
run: |
mkdir -p $CERTSUITE_CONFIG_DIR $CERTSUITE_OUTPUT_DIR
cp /home/runner/.kube/config $CERTSUITE_CONFIG_DIR/kubeconfig
cp /home/runner/.docker/config $CERTSUITE_CONFIG_DIR/dockerconfig
cp config/*.yml $CERTSUITE_CONFIG_DIR
shell: bash
working-directory: certsuite
- name: 'Test: Run without any TS, just get diagnostic information'
run: |
docker run --rm --network host \
-v $CERTSUITE_CONFIG_DIR:/usr/certsuite/config:Z \
-v $CERTSUITE_OUTPUT_DIR:/usr/certsuite/output:Z \
${REGISTRY}/${CERTSUITE_IMAGE_NAME}:${CERTSUITE_IMAGE_TAG} \
certsuite run \
--output-dir=/usr/certsuite/output \
--preflight-dockerconfig=/usr/certsuite/config/dockerconfig \
--offline-db=/usr/offline-db \
--log-level=${SMOKE_TESTS_LOG_LEVEL} \
--config-file=/usr/certsuite/config/certsuite_config.yml \
--kubeconfig=/usr/certsuite/config/kubeconfig \
working-directory: certsuite
- name: 'Test: Run Smoke Tests in a TNF container'
run: |
docker run --rm --network host \
-v $CERTSUITE_CONFIG_DIR:/usr/certsuite/config:Z \
-v $CERTSUITE_OUTPUT_DIR:/usr/certsuite/output:Z \
${REGISTRY}/${CERTSUITE_IMAGE_NAME}:${CERTSUITE_IMAGE_TAG} \
certsuite run \
--output-dir=/usr/certsuite/output \
--preflight-dockerconfig=/usr/certsuite/config/dockerconfig \
--offline-db=/usr/offline-db \
--enable-data-collection=true \
--log-level=${SMOKE_TESTS_LOG_LEVEL} \
--config-file=/usr/certsuite/config/certsuite_config.yml \
--kubeconfig=/usr/certsuite/config/kubeconfig \
--label-filter="${SMOKE_TESTS_LABELS_FILTER}"
working-directory: certsuite
- name: Build the TNF tool
run: make build-certsuite-tool
working-directory: certsuite
- name: Check the smoke test results against the expected results template
run: ./certsuite check results --log-file="${CERTSUITE_OUTPUT_DIR}"/certsuite.log
working-directory: certsuite