|
| 1 | +name: Lint & E2E Tests (Experimental) |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: |
| 6 | + - opened |
| 7 | + - synchronize |
| 8 | + push: |
| 9 | + branches: |
| 10 | + - master |
| 11 | + schedule: |
| 12 | + - cron: "0 1 * * *" |
| 13 | + workflow_dispatch: |
| 14 | + |
| 15 | +jobs: |
| 16 | + helm-lint: |
| 17 | + runs-on: ubuntu-22.04 |
| 18 | + timeout-minutes: 10 |
| 19 | + steps: |
| 20 | + - name: Checkout source |
| 21 | + uses: actions/checkout@v3 |
| 22 | + |
| 23 | + - name: Update stackstorm-ha chart dependencies |
| 24 | + run: | |
| 25 | + set -x |
| 26 | + helm dependency update |
| 27 | +
|
| 28 | + - name: Helm lint |
| 29 | + run: | |
| 30 | + helm lint |
| 31 | +
|
| 32 | + - name: Cache community |
| 33 | + id: cache-community |
| 34 | + uses: actions/cache@v3 |
| 35 | + with: |
| 36 | + path: community |
| 37 | + key: ${{ runner.os }}-community-${{ hashFiles('conf/**', 'templates/**', 'Chart.yaml', 'values.yaml') }} |
| 38 | + |
| 39 | + - name: Helm template |
| 40 | + if: steps.cache-community.outputs.cache-hit != 'true' |
| 41 | + shell: bash |
| 42 | + run: | |
| 43 | + helm template --output-dir community . |
| 44 | +
|
| 45 | + k8s-lint: |
| 46 | + runs-on: ubuntu-22.04 |
| 47 | + timeout-minutes: 10 |
| 48 | + needs: [helm-lint] |
| 49 | + steps: |
| 50 | + - name: Checkout source |
| 51 | + uses: actions/checkout@v3 |
| 52 | + |
| 53 | + - name: Cache community |
| 54 | + id: cache-community |
| 55 | + uses: actions/cache@v3 |
| 56 | + with: |
| 57 | + path: community |
| 58 | + key: ${{ runner.os }}-community-${{ hashFiles('conf/**', 'templates/**', 'Chart.yaml', 'values.yaml') }} |
| 59 | + |
| 60 | + - name: Kubernetes kubeval lint |
| 61 | + uses: instrumenta/kubeval-action@master |
| 62 | + with: |
| 63 | + files: community |
| 64 | + |
| 65 | + helm-e2e: |
| 66 | + needs: [k8s-lint] |
| 67 | + runs-on: ubuntu-22.04 |
| 68 | + # NOTE: Just a thought in case the timeouts fail; might not be |
| 69 | + # necessary, but might not hurt either, would vary based on the |
| 70 | + # size of the testing matrix, too. |
| 71 | + timeout-minutes: 30 |
| 72 | + strategy: |
| 73 | + fail-fast: false |
| 74 | + max-parallel: 1 |
| 75 | + matrix: |
| 76 | + # TODO: Document which versions we support and cover them. |
| 77 | + k3s-channel: |
| 78 | + - "v1.25.4+k3s1" |
| 79 | + steps: |
| 80 | + - name: Checkout source |
| 81 | + uses: actions/checkout@v3 |
| 82 | + |
| 83 | + - name: Set up K3s |
| 84 | + id: k3s |
| 85 | + uses: jupyterhub/action-k3s-helm@v3 |
| 86 | + with: |
| 87 | + k3s-channel: ${{ matrix.k3s-channel }} |
| 88 | + |
| 89 | + - name: Update stackstorm-ha chart dependencies |
| 90 | + run: | |
| 91 | + set -x |
| 92 | + helm dependency update |
| 93 | +
|
| 94 | + - name: Helm install |
| 95 | + run: | |
| 96 | + helm install --timeout 10m0s --debug --wait \ |
| 97 | + --name-template stackstorm-ha . |
| 98 | +
|
| 99 | + - name: Helm test |
| 100 | + run: | |
| 101 | + helm test stackstorm-ha |
| 102 | +
|
| 103 | + - name: Helm upgrade with RBAC enabled |
| 104 | + run: | |
| 105 | + helm upgrade --set st2.rbac.enabled=true \ |
| 106 | + --timeout 5m0s --debug --wait stackstorm-ha . |
| 107 | +
|
| 108 | + - name: Helm test |
| 109 | + run: | |
| 110 | + helm test stackstorm-ha |
| 111 | +
|
| 112 | + - name: Show all Kubernetes resources |
| 113 | + if: ${{ always() }} |
| 114 | + run: | |
| 115 | + kubectl get all |
0 commit comments