Merge pull request #286 from k8stopologyawareschedwg/bump-kind-releas… #66
Workflow file for this run
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
name: Release | |
on: | |
push: | |
# Sequence of patterns matched against refs/tags | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
release: | |
runs-on: ubuntu-22.04 | |
env: | |
RTE_CONTAINER_IMAGE: quay.io/k8stopologyawareschedwg/resource-topology-exporter | |
E2E_TOPOLOGY_MANAGER_POLICY: single-numa-node | |
E2E_TOPOLOGY_MANAGER_SCOPE: container | |
steps: | |
- name: checkout sources | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: setup golang | |
uses: actions/setup-go@v3 | |
id: go | |
with: | |
go-version: 1.20.7 | |
- name: verify modules | |
run: go mod verify | |
- name: set release version env var | |
run: | | |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: build test binary | |
run: | | |
make build-e2e | |
- name: build image | |
run: | | |
RTE_CONTAINER_IMAGE=${{ env.RTE_CONTAINER_IMAGE }}:${{ env.RELEASE_VERSION }} RUNTIME=docker make image | |
- name: generate manifests | |
run: | | |
mkdir _dist | |
RTE_CONTAINER_IMAGE=${{ env.RTE_CONTAINER_IMAGE }}:${{ env.RELEASE_VERSION }} RTE_POLL_INTERVAL=10s make gen-manifests | tee _dist/resource-topology-exporter-${{ env.RELEASE_VERSION }}.yaml | |
- name: create K8S kind cluster | |
run: | | |
# kind is part of 20.04 image, see: https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md | |
# see image listing in https://github.com/kubernetes-sigs/kind/releases/tag/v0.20.0 | |
kind create cluster --config=hack/kind-config-e2e.yaml --image kindest/node:v1.27.3@sha256:3966ac761ae0136263ffdb6cfd4db23ef8a83cba8a463690e98317add2c9ba72 | |
kind load docker-image ${{ env.RTE_CONTAINER_IMAGE }}:${{ env.RELEASE_VERSION }} | |
- name: deploy RTE | |
run: | | |
# TODO: what about the other workers (if any)? | |
kubectl label node kind-worker node-role.kubernetes.io/worker='' | |
kubectl create -f _dist/resource-topology-exporter-${{ env.RELEASE_VERSION }}.yaml | |
- name: cluster info | |
run: | | |
kubectl get nodes | |
kubectl get pods -A | |
kubectl describe pod -l name=resource-topology || : | |
kubectl logs -l name=resource-topology -c resource-topology-exporter-container || : | |
- name: cluster ready | |
run: | | |
hack/check-ds.sh | |
kubectl logs -l name=resource-topology -c resource-topology-exporter-container || : | |
kubectl get noderesourcetopologies.topology.node.k8s.io -A -o yaml | |
- name: run E2E tests | |
run: | | |
export KUBECONFIG=${HOME}/.kube/config | |
export E2E_DEVICE_NAME= | |
_out/rte-e2e.test -ginkgo.focus='\[release\]' | |
- name: compute signature | |
run: | | |
pushd _dist && sha256sum * >> ../SHA256SUMS && mv ../SHA256SUMS . && popd | |
- name: upload build artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: build-artifacts | |
path: _dist/* | |
- name: create release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "_dist/*" | |
token: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
- name: login to quay.io | |
uses: docker/login-action@v1 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_IO_USERNAME }} | |
password: ${{ secrets.QUAY_IO_ROBOTOKEN }} | |
- name: publish image | |
run: | | |
docker push ${{ env.RTE_CONTAINER_IMAGE }}:${{ env.RELEASE_VERSION }} | |
- name: export kind logs | |
if: ${{ failure() }} | |
run: | | |
kind export logs /tmp/kind-logs | |
- name: archive kind logs | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: kind-logs | |
path: /tmp/kind-logs |