Skip to content

chore: update package kube-prometheus-stack #1539

chore: update package kube-prometheus-stack

chore: update package kube-prometheus-stack #1539

Workflow file for this run

name: Test packages
on:
pull_request:
branches:
- main
jobs:
setup:
name: package_install_setup
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 2
- name: Git diff
id: diff
run: echo "changes=$(git diff --name-only HEAD~1 | grep -E "packages/[^/]+/[^/]+/.+" | cut -d / -f 2,3 -s | sort | uniq | jq -cnR '[inputs | split("/")]')" >> $GITHUB_OUTPUT
outputs:
changes: ${{ steps.diff.outputs.changes }}
test:
name: package_install
runs-on: ubuntu-latest
needs:
- setup
if: needs.setup.outputs.changes != '[]'
strategy:
matrix:
change: ${{ fromJson(needs.setup.outputs.changes) }}
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Get latest Glasskube version
id: version
run: echo "version=$(curl https://glasskube.dev/release.json | jq -r .version)" >> $GITHUB_OUTPUT
- name: Install glasskube
run: curl -fL "https://github.com/glasskube/glasskube/releases/download/v${{ steps.version.outputs.version }}/glasskube_v${{ steps.version.outputs.version }}_linux_x86_64.tar.gz" | tar -xz
- name: Check glasskube
run: ./glasskube --version
- name: Start local webserver
uses: Eun/http-server-action@f71cec1321f665652a46c40b6852f8e5a68bfcd4 # v1
with:
directory: ${{ github.workspace }}
port: 9090
- name: Add host.minikube.internal to /etc/hosts
run: sudo echo "127.0.0.1 host.minikube.internal" | sudo tee -a /etc/hosts
- name: Check local webserver
run: curl -v "http://host.minikube.internal:9090/packages/${{ matrix.change[0] }}/${{ matrix.change[1] }}/package.yaml"
- name: Start minikube cluster
uses: medyagh/setup-minikube@d8c0eb871f6f455542491d86a574477bd3894533 # v0.0.18
- name: Minikube Tunnel
run: minikube tunnel &
- name: Bootstrap Glasskube in Minikube cluster
run: ./glasskube bootstrap --disable-telemetry --no-progress --create-default-repository=false
- name: Add local repository
run: ./glasskube repo add local "http://host.minikube.internal:9090/packages/" --default
- name: Fetch test config values
id: config
run: echo "config=$(curl -fL http://host.minikube.internal:9090/packages/${{ matrix.change[0] }}/${{ matrix.change[1] }}/.test/config-values.txt)" >> $GITHUB_OUTPUT
- name: Install package in Minikube cluster
run: ./glasskube install "${{ matrix.change[0] }}" ${{ steps.config.outputs.config }} --repository="local" --version="${{ matrix.change[1] }}" --yes --non-interactive --no-progress
- name: Check package status
run: |
./glasskube describe "${{ matrix.change[0] }}" | grep -E "Status: *Ready"
conclusion:
name: package_install_conclusion
runs-on: ubuntu-latest
needs:
- setup
- test
if: always() && github.event_name == 'pull_request'
steps:
- run: |
CHANGES='${{ needs.setup.outputs.changes }}'
TEST_RESULT='${{ needs.test.result }}'
if [[ "$TEST_RESULT" = "failure" ]] || [[ "$TEST_RESULT" = "cancelled" ]]; then
echo "test job has result $TEST_RESULT --> error"
exit 1
fi
if [[ "$TEST_RESULT" = "skipped" ]] && [[ "$CHANGES" != "[]" ]]; then
echo "test job has result $TEST_RESULT but changes is not empty --> error"
exit 1
fi
echo "test job has result $TEST_RESULT --> ok"