Bumped redis version #34
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: Pull Request Workflow | |
on: | |
pull_request: | |
branches: | |
- main | |
env: | |
GO_VERSION: ^1.20 | |
HELM_VERSION: v3.11.2 | |
PYTHON_VERSION: 3.7 # required for helm tester | |
jobs: | |
run-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Run golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
args: --timeout=3m --enable exportloopref | |
skip-pkg-cache: true | |
skip-build-cache: true | |
- name: Run integration tests | |
run: make test | |
build-operator: | |
runs-on: ubuntu-latest | |
needs: run-tests | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build operator image | |
uses: docker/build-push-action@v4 | |
with: | |
tags: ibmcom/operator-for-redis:local | |
file: Dockerfile.operator | |
build-cluster-node: | |
runs-on: ubuntu-latest | |
needs: run-tests | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build redis node image | |
uses: docker/build-push-action@v4 | |
with: | |
tags: ibmcom/node-for-redis:local | |
file: Dockerfile.node | |
build-metrics: | |
runs-on: ubuntu-latest | |
needs: run-tests | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build redis metrics image | |
uses: docker/build-push-action@v4 | |
with: | |
tags: ibmcom/metrics-for-redis:local | |
file: Dockerfile.metrics | |
validate-helm-charts: | |
runs-on: ubuntu-latest | |
needs: run-tests | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # ct needs history to compare | |
- name: Setup Helm | |
uses: azure/setup-helm@v3.5 | |
with: | |
version: ${{ env.HELM_VERSION }} | |
- name: Setup Python | |
uses: actions/setup-python@v4.7.0 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Setup chart-testing | |
uses: helm/chart-testing-action@v2.4.0 | |
- name: Run chart-testing (list-changed) | |
id: list-changed | |
run: | | |
changed=$(ct list-changed --target-branch=main) | |
if [[ -n "$changed" ]]; then | |
echo "::set-output name=changed::true" | |
fi | |
- name: Run chart-testing (lint) | |
run: ct lint --target-branch=main --check-version-increment=false | |
check-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.17.1 # This is recommended LTS version which includes npm 6.14.10 | |
- name: Build docs website | |
run: | | |
npm -v | |
node -v | |
cd docs | |
npm ci | |
npm run build | |
run-e2e-tests: | |
runs-on: ubuntu-latest | |
needs: [build-operator, build-cluster-node, build-metrics, validate-helm-charts] | |
strategy: | |
fail-fast: false | |
matrix: | |
kubernetes-version: [ "1.26" ] #, "1.25", "1.24", "1.23"] | |
include: | |
- kubernetes-version: "1.26" | |
kind-node: kindest/node:v1.26.3@sha256:61b92f38dff6ccc29969e7aa154d34e38b89443af1a2c14e6cfbd2df6419c66f | |
# - kubernetes-version: "1.25" | |
# kind-node: kindest/node:v1.25.8@sha256:00d3f5314cc35327706776e95b2f8e504198ce59ac545d0200a89e69fce10b7f | |
# - kubernetes-version: "1.24" | |
# kind-node: kindest/node:v1.24.12@sha256:1e12918b8bc3d4253bc08f640a231bb0d3b2c5a9b28aa3f2ca1aee93e1e8db16 | |
# - kubernetes-version: "1.23" | |
# kind-node: kindest/node:v1.23.17@sha256:e5fd1d9cd7a9a50939f9c005684df5a6d145e8d695e78463637b79464292e66c | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Build images | |
run: | | |
docker build -f Dockerfile.operator -t ibmcom/operator-for-redis:local . | |
docker build -f Dockerfile.node -t ibmcom/node-for-redis:local -t ibmcom/node-for-redis:new . | |
docker build -f Dockerfile.metrics -t ibmcom/metrics-for-redis:local . | |
- name: kind create cluster | |
uses: helm/kind-action@v1.8.0 | |
with: | |
version: v0.18.0 | |
config: ./test/e2e/kind_config.yml | |
cluster_name: kind | |
node_image: ${{ matrix.kind-node }} | |
wait: 120s | |
- name: Load Images to KIND | |
run: | | |
kind load docker-image ibmcom/operator-for-redis:local | |
kind load docker-image ibmcom/node-for-redis:local | |
kind load docker-image ibmcom/node-for-redis:new | |
kind load docker-image ibmcom/metrics-for-redis:local | |
- name: Install operator-for-redis with Helm | |
id: helm | |
run: helm install operator-for-redis charts/operator-for-redis --wait --set image.repository=ibmcom/operator-for-redis --set image.tag=local --set logLevel=7 | |
- name: Run e2e tests | |
id: e2e | |
run: go test -timeout 30m ./test/e2e --kubeconfig=$HOME/.kube/config --ginkgo.v --test.v | |
- name: Capture logs if e2e failed | |
if: ${{ always() && (steps.e2e.outcome == 'failure' || steps.helm.outcome == 'failure') }} | |
run: | | |
mkdir ./kind-logs | |
kind export logs ./kind-logs | |
tar -cvf kind-e2e-logs-${{ matrix.kubernetes-version }}.tar ./kind-logs | |
- name: Upload logs artifact | |
if: ${{ always() && (steps.e2e.outcome == 'failure' || steps.helm.outcome == 'failure') }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: kind-e2e-logs-${{ matrix.kubernetes-version }}.tar | |
path: kind-e2e-logs-${{ matrix.kubernetes-version }}.tar | |
retention-days: 7 |