From 127c6e21cc358102ccbaf9aacf6df66c9fb4c466 Mon Sep 17 00:00:00 2001 From: Eduardo Apolinario Date: Mon, 13 May 2024 15:52:01 -0700 Subject: [PATCH] Add sandbox test and flytectl-release gh workflow Signed-off-by: Eduardo Apolinario --- .github/workflows/checks.yml | 56 ++++++++++++++++++++++++++ .github/workflows/flytectl-release.yml | 24 +++++------ 2 files changed, 67 insertions(+), 13 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 4c66549cb9..f6265977c1 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -117,3 +117,59 @@ jobs: secrets: FLYTE_BOT_PAT: ${{ secrets.FLYTE_BOT_PAT }} FLYTE_BOT_USERNAME: ${{ secrets.FLYTE_BOT_USERNAME }} + + dry_run_goreleaser: + name: Dry Run Goreleaser + runs-on: ubuntu-latest + needs: + - unpack-envvars + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: "0" + - uses: actions/setup-go@v4 + with: + go-version: ${{ needs.unpack-envvars.outputs.go-version }} + - name: Run GoReleaser dry run + uses: goreleaser/goreleaser-action@v5 + with: + distribution: goreleaser-pro + version: latest + args: --snapshot --skip-publish --rm-dist -f flytectl/.goreleaser.yml + env: + GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} + + sandbox: + name: Test Getting started + runs-on: ubuntu-latest + defaults: + run: + working-directory: flytectl + needs: + - unpack-envvars + steps: + - uses: insightsengineering/disk-space-reclaimer@v1 + - name: Checkout + uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }} + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: ${{ needs.unpack-envvars.outputs.go-version }} + - name: Build Flytectl binary + run: make compile + - name: Create a sandbox cluster + run: | + bin/flytectl demo start + - name: Setup flytectl config + run: bin/flytectl config init + - name: Register cookbook + run: bin/flytectl register examples -d development -p flytesnacks + - name: Teardown Sandbox cluster + run: bin/flytectl demo teardown diff --git a/.github/workflows/flytectl-release.yml b/.github/workflows/flytectl-release.yml index 2ff69270a2..a222562703 100644 --- a/.github/workflows/flytectl-release.yml +++ b/.github/workflows/flytectl-release.yml @@ -1,28 +1,26 @@ -name: Flytectl checks +name: Flytectl release on: - pull_request: - paths-ignore: - - "docs/**" - - "boilerplate/**" + push: + tags: + - flytectl/v*.*.* jobs: - dry_run_goreleaser: - name: Dry Run Goreleaser + release: + name: Goreleaser runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: fetch-depth: "0" - - uses: actions/setup-go@v4 + - name: Set up Go + uses: actions/setup-go@v4 with: go-version: "1.21" - - name: Run GoReleaser dry run + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5 with: distribution: goreleaser-pro - version: latest - args: --snapshot --skip-publish --rm-dist -f flytectl/.goreleaser.yml + args: release --rm-dist -f flytectl/.goreleaser.yml env: GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}