Make the repo more user friendly with docs #406
Workflow file for this run
This file contains hidden or 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: CI | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "**.yaml" | |
| - "**.tpl" | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - "**.yaml" | |
| - "**.tpl" | |
| jobs: | |
| sanity: | |
| runs-on: ubuntu-latest | |
| name: sanity render chart | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: azure/setup-helm@v4.1.0 | |
| - run: helm template mirrord-operator --set license.key=secret --debug | |
| - run: helm template mirrord-license-server --set license.key=secret --set license.file.data.license\\.pem=secret --debug | |
| operator-install: | |
| runs-on: ubuntu-latest | |
| name: install chart | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: start minikube | |
| uses: metalbear-co/setup-minikube@3fa06c2257eb48a3ca8e24fedece59ee2479255a | |
| with: | |
| container-runtime: ${{ inputs.container-runtime }} | |
| cpus: 'max' | |
| memory: '4gb' | |
| - uses: azure/setup-helm@v4.1.0 | |
| - name: prepare custom namespaces for `test_values/operator_rolenamespaces.yaml` | |
| run: kubectl create namespace namespace1 && kubectl create namespace namespace2 | |
| - name: check installing the chart with various `values` yamls | |
| run: ./test_values_files.sh | |
| operator-install-and-use: | |
| runs-on: ubuntu-latest | |
| name: install chart and run session | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: start minikube | |
| uses: metalbear-co/setup-minikube@3fa06c2257eb48a3ca8e24fedece59ee2479255a | |
| with: | |
| container-runtime: ${{ inputs.container-runtime }} | |
| cpus: 'max' | |
| memory: '4gb' | |
| - uses: azure/setup-helm@v4.1.0 | |
| - name: prepare operator license | |
| env: | |
| MIRRORD_OPERATOR_LICENSE: ${{ secrets.MIRRORD_OPERATOR_LICENSE }} | |
| run: echo $MIRRORD_OPERATOR_LICENSE | base64 --decode > license.pem | |
| - name: print license file hash | |
| run: cat license.pem | sha256sum | |
| - name: install the chart | |
| run: | | |
| helm install mirrord-operator \ | |
| --set license.file.data."license\\.pem"="$(cat license.pem)" \ | |
| --set operator.disableTelemetries=true \ | |
| --set operator.podAnnotations."annotation\.metalbear\.co/name"="operator" \ | |
| --set operator.podAnnotations."annotation\.metalbear\.co/version"="latest" \ | |
| --set operator.podLabels."label\.metalbear\.co/name"="operator" \ | |
| --set operator.podLabels."label\.metalbear\.co/version"="latest" \ | |
| ./mirrord-operator --wait | |
| - name: wait for the operator status | |
| uses: metalbear-co/retry@9417ab499314dfe692edb043ded2ff9b3f5f0a68 | |
| with: | |
| timeout_seconds: 10 | |
| max_attempts: 5 | |
| retry_wait_seconds: 1 | |
| command: kubectl get mirrordoperators.operator.metalbear.co operator -o yaml | |
| - name: download latest mirrord binary | |
| run: curl -LO https://github.com/metalbear-co/mirrord/releases/latest/download/mirrord_linux_x86_64 && chmod +x ./mirrord_linux_x86_64 | |
| - name: run dummy mirrord session | |
| run: MIRRORD_OPERATOR_ENABLE=true MIRRORD_TELEMETRY=false ./mirrord_linux_x86_64 exec -- echo whatever | |
| - name: get operator logs | |
| if: failure() | |
| run: kubectl logs -n mirrord deployment/mirrord-operator | |
| operator-install-with-license-server-and-use: | |
| runs-on: ubuntu-latest | |
| name: install chart and run session (with license-server) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: start minikube | |
| uses: metalbear-co/setup-minikube@3fa06c2257eb48a3ca8e24fedece59ee2479255a | |
| with: | |
| container-runtime: ${{ inputs.container-runtime }} | |
| cpus: 'max' | |
| memory: '4gb' | |
| - uses: azure/setup-helm@v4.1.0 | |
| - name: prepare operator license | |
| env: | |
| MIRRORD_OPERATOR_LICENSE: ${{ secrets.MIRRORD_OPERATOR_LICENSE }} | |
| run: echo $MIRRORD_OPERATOR_LICENSE | base64 --decode > license.pem | |
| - name: print license file hash | |
| run: cat license.pem | sha256sum | |
| - name: install the chart (license-server) | |
| run: | | |
| helm install mirrord-license-server \ | |
| --set createNamespace=true \ | |
| --set license.key="secret" \ | |
| --set license.file.data."license\\.pem"="$(cat license.pem)" \ | |
| ./mirrord-license-server --wait | |
| - name: install the chart | |
| run: | | |
| helm install mirrord-operator \ | |
| --set createNamespace=false \ | |
| --set license.key="secret" \ | |
| --set license.file.secret="mirrord-operator-license-key" \ | |
| --set license.licenseServer="http://mirrord-operator-license-server.mirrord.svc" \ | |
| --set operator.disableTelemetries=false \ | |
| --set operator.podAnnotations."annotation\.metalbear\.co/name"="operator" \ | |
| --set operator.podAnnotations."annotation\.metalbear\.co/version"="latest" \ | |
| --set operator.podLabels."label\.metalbear\.co/name"="operator" \ | |
| --set operator.podLabels."label\.metalbear\.co/version"="latest" \ | |
| ./mirrord-operator --wait | |
| - name: wait for the operator status | |
| uses: metalbear-co/retry@9417ab499314dfe692edb043ded2ff9b3f5f0a68 | |
| with: | |
| timeout_seconds: 10 | |
| max_attempts: 5 | |
| retry_wait_seconds: 1 | |
| command: kubectl get mirrordoperators.operator.metalbear.co operator -o yaml | |
| - name: download latest mirrord binary | |
| run: curl -LO https://github.com/metalbear-co/mirrord/releases/latest/download/mirrord_linux_x86_64 && chmod +x ./mirrord_linux_x86_64 | |
| - name: run dummy mirrord session | |
| run: MIRRORD_OPERATOR_ENABLE=true MIRRORD_TELEMETRY=false ./mirrord_linux_x86_64 exec -- echo whatever | |
| - name: get operator logs | |
| if: failure() | |
| run: kubectl logs -n mirrord deployment/mirrord-operator | |
| - name: get license-server logs | |
| if: failure() | |
| run: kubectl logs -n mirrord deployment/mirrord-license-server | |
| towncrier_check: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v2 | |
| - run: uv python install | |
| - run: uv venv | |
| - name: install towncrier | |
| run: uv pip install towncrier==23.11.0 | |
| - name: verify newsfragment exist | |
| run: uv run towncrier check | |
| ci-success: | |
| runs-on: ubuntu-latest | |
| name: ci-success | |
| # We want this to run even if some of the required jobs got skipped | |
| if: always() | |
| needs: | |
| [ | |
| sanity, | |
| operator-install, | |
| operator-install-and-use, | |
| operator-install-with-license-server-and-use, | |
| towncrier_check, | |
| ] | |
| steps: | |
| - name: CI succeeded | |
| # We have to do it in the shell since if it's in the if condition | |
| # then skipping is considered success by branch protection rules | |
| env: | |
| CI_SUCCESS: ${{ (needs.sanity.result == 'success') && | |
| (needs.operator-install.result == 'success') && | |
| (needs.operator-install-and-use.result == 'success') && | |
| (needs.towncrier_check.result == 'success') }} | |
| run: echo $CI_SUCCESS && if [ "$CI_SUCCESS" == "true" ]; then echo "SUCCESS" && exit 0; else echo "FAILURE" && exit 1; fi |