Skip to content

feat(scale): fix subresource compatibility + HPA integration #157

feat(scale): fix subresource compatibility + HPA integration

feat(scale): fix subresource compatibility + HPA integration #157

Workflow file for this run

name: Tests
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
env:
GO_VERSION: '~1.24'
jobs:
test:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- run: go mod tidy
- run: make test
- uses: actions/upload-artifact@v4
with:
name: coverprofile-unit
path: ${{ github.workspace }}/cover.out
if-no-files-found: ignore
retention-days: 1
test-e2e:
name: E2E Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- run: go mod tidy
- run: make test-e2e
- run: go tool covdata textfmt -i /tmp/kind/data/emqx-operator-system/test-e2e-coverage -o ${{ github.workspace }}/cover.e2e.out
- uses: actions/upload-artifact@v4
with:
name: coverprofile-e2e
path: ${{ github.workspace }}/cover.e2e.out
if-no-files-found: ignore
retention-days: 1
test-upgrade:
name: E2E Upgrade Tests - ${{ matrix.profile }}
strategy:
fail-fast: false
matrix:
include:
- initial: "emqx/emqx:5.10.2"
upgrade: "emqx/emqx:6.1.0"
profile: "5.10.2-6.1.0"
- initial: "emqx/emqx:6.0.2"
upgrade: "emqx/emqx:6.1.0"
profile: "6.0.2-6.1.0"
runs-on: ubuntu-latest
env:
TEST_E2E_DIAGNOSTIC_REPORT_PATH: ${{ github.workspace }}/test-report
steps:
- uses: jlumbroso/free-disk-space@v1.3.1
with:
docker-images: false
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- run: go mod tidy
- run: make test-e2e-upgrade
env:
TEST_E2E_UPGRADE_IMAGE_INITIAL: ${{ matrix.initial }}
TEST_E2E_UPGRADE_IMAGE_UPGRADE: ${{ matrix.upgrade }}
- uses: actions/upload-artifact@v4
if: failure()
with:
name: test-report-upgrade-${{ matrix.profile }}
path: ${{ env.TEST_E2E_DIAGNOSTIC_REPORT_PATH }}
if-no-files-found: ignore
- run: go tool covdata textfmt -i /tmp/kind/data/emqx-operator-system/test-e2e-coverage -o ${{ github.workspace }}/cover.upgrade.out
- uses: actions/upload-artifact@v4
with:
name: coverprofile-upgrade-${{ matrix.profile }}
path: ${{ github.workspace }}/cover.upgrade.out
if-no-files-found: ignore
retention-days: 1
test-e2e-helm:
name: E2E Helm Upgrade Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- run: go mod tidy
- run: make test-e2e-helm
codecov:
runs-on: ubuntu-latest
needs: [test, test-e2e, test-upgrade]
steps:
- uses: actions/download-artifact@v4
with:
pattern: coverprofile-*
path: /tmp/coverprofile
- name: Get cover files
id: files
run: |
files="$(find /tmp/coverprofile -type f -exec readlink -f '{}' ';' | tr '\n' ',' | sed 's/,$//g')"
echo "files=$files" | tee -a $GITHUB_OUTPUT
- uses: codecov/codecov-action@v4
with:
files: ${{ steps.files.outputs.files }} # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
token: ${{ secrets.CODECOV_TOKEN }} # required
- uses: geekyeggo/delete-artifact@v5
with:
name: coverprofile-*