Skip to content

chore(deps): bump the go-deps group across 1 directory with 5 updates #146

chore(deps): bump the go-deps group across 1 directory with 5 updates

chore(deps): bump the go-deps group across 1 directory with 5 updates #146

Workflow file for this run

name: unit-and-e2e-tests
on:
push:
branches:
- "**"
paths-ignore:
- "*.md"
- LICENSE
- docker-compose*
- .dockerignore
#- .github/
- .gitignore
- .gitmodules
- docs/
- hack/
- Makefile
- PROJECT
pull_request:
branches:
- "!dependabot/**"
env:
go_version: '1.23'
artifact_name: kubernetes-namespace-permission-manager
artifact_bin_name: kubebuilder
IMG: tagesspiegel/kubernetes-namespace-permission-manager:dev
jobs:
vetting:
name: vetting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
ref: ${{ github.ref }}
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
- name: vetting
shell: bash
run: go vet ./...
linting:
name: linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
ref: ${{ github.ref }}
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
args: --timeout=3m --issues-exit-code=1 ./...
only-new-issues: true
unit-tests:
name: unit tests
runs-on: ubuntu-latest
needs:
- vetting
- linting
env:
LOG_DIR: logs
FORMATTED_LOG_FOLDER_NAME: ""
steps:
- name: Install go ${{ env.go_version }}
uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Run unit tests
run: make test
prepare-bin:
name: prepare-bin
runs-on: ubuntu-latest
needs:
- vetting
- linting
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download binaries
run: |
make kustomize controller-gen envtest
- name: Upload bin directory
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact_bin_name }}
path: bin/
retention-days: 1
build-temp-image:
name: build docker image
runs-on: ubuntu-latest
needs:
- vetting
- linting
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build image
run: |
make docker-build
- name: Save image
run: |
make docker-save
- name: Upload image
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact_name }}
path: manager.tar
retention-days: 1
end-to-end-tests:
name: e2e tests
runs-on: ubuntu-latest
needs:
- vetting
- linting
- build-temp-image
- prepare-bin
env:
KUBERNETES_NAMESPACE: kubernetes-namespace-permission-manager-system
strategy:
fail-fast: false
matrix:
kind_node_image:
- kindest/node:v1.30.0
- kindest/node:v1.29.4
- kindest/node:v1.28.9
- kindest/node:v1.27.13
- kindest/node:v1.26.15
steps:
- name: Install go ${{ env.go_version }}
uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
- uses: azure/setup-helm@v4
with:
version: 'latest'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
name: ${{ env.artifact_name }}
- uses: actions/download-artifact@v4
with:
name: ${{ env.artifact_bin_name }}
path: bin/
- run: |
sudo chown -R $USER:$USER bin/
sudo chmod -R a+rwx bin/
- name: Load image
run: |
make docker-load
- name: Create K8s Kind Cluster
uses: helm/[email protected]
with:
node_image: ${{ matrix.kind_node_image }}
cluster_name: kubernetes-namespace-permission-manager-e2e
- name: Load image into kind cluster
run: |
kind load docker-image ${{ env.IMG }} --name kubernetes-namespace-permission-manager-e2e
- name: Install Prometheus Operator CRDs
run: |
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
helm install prometheus-operator-crds prometheus-community/prometheus-operator-crds
- name: Deploy operator
run: |
make install
make deploy
- name: Wait and check operator is running
run: |
sleep 20
kubectl get pods -n ${{ env.KUBERNETES_NAMESPACE }}
- name: Get operator logs
if: always()
run: |
kubectl logs --tail 10000 -n ${{ env.KUBERNETES_NAMESPACE }} $(kubectl get pods -n ${{ env.KUBERNETES_NAMESPACE }} | grep kubernetes-namespace-permission-manager-controller-manager | awk '{print $1}') -c manager
- name: Describe operator pod
if: always()
run: |
kubectl describe pod -n ${{ env.KUBERNETES_NAMESPACE }} $(kubectl get pods -n ${{ env.KUBERNETES_NAMESPACE }} | grep kubernetes-namespace-permission-manager-controller-manager | awk '{print $1}')
- name: Run e2e tests
run: |
make test-e2e
- name: Get operator logs
if: always()
run: |
kubectl logs --tail 10000 -n ${{ env.KUBERNETES_NAMESPACE }} $(kubectl get pods -n ${{ env.KUBERNETES_NAMESPACE }} | grep kubernetes-namespace-permission-manager-controller-manager | awk '{print $1}') -c manager