From a52d73f50937f851a3d024f436d9fcf2aebcfc97 Mon Sep 17 00:00:00 2001 From: Zack Hodgson Brady Date: Fri, 5 Apr 2024 18:30:25 -0400 Subject: [PATCH 1/3] cleaned up unit test workflow --- .github/workflows/unittest.yaml | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/.github/workflows/unittest.yaml b/.github/workflows/unittest.yaml index ca6ef99d..663758e4 100644 --- a/.github/workflows/unittest.yaml +++ b/.github/workflows/unittest.yaml @@ -1,43 +1,37 @@ name: Unit Test Workflow on: + workflow_dispatch: push: - paths-ignore: - - '**.md' - - '.github/**' - - '!.github/workflows/unittest.yaml' + branches: + - main pull_request: - paths-ignore: - - '**.md' - - '.github/**' - - '!.github/workflows/unitcoverage.yaml' - workflow_dispatch: {} + branches: + - main jobs: - test: + unit-test: name: Unit Tests runs-on: ubuntu-latest timeout-minutes: 30 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Install Go - uses: actions/setup-go@v2 + + - name: Set Up Go + uses: actions/setup-go@v5 with: go-version: 1.21.x + - name: Run Unit Tests run: | mkdir -p cmd/hauler/binaries touch cmd/hauler/binaries/dummy.txt go test -race -covermode=atomic -coverprofile=coverage.out ./pkg/... ./internal/... ./cmd/... + - name: On Failure, Launch Debug Session if: ${{ failure() }} uses: mxschmitt/action-tmate@v3 - timeout-minutes: 5 - - name: Upload Results To Codecov - uses: codecov/codecov-action@v1 - with: - files: ./coverage.out - verbose: true # optional (default = false) + timeout-minutes: 10 From 87ce8ad62f42d3d6884cff0a880f0684d185c2b9 Mon Sep 17 00:00:00 2001 From: Zack Hodgson Brady Date: Fri, 5 Apr 2024 18:49:31 -0400 Subject: [PATCH 2/3] updated/cleaned up release workflow --- .github/workflows/release.yaml | 49 ++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index dd7b1524..9a33c24b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -7,25 +7,58 @@ on: - '*' jobs: - goreleaser: - name: Release + go-release: + name: Go Release Job runs-on: ubuntu-latest timeout-minutes: 30 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Go - uses: actions/setup-go@v2 + + - name: Set Up Go + uses: actions/setup-go@v5 with: go-version: 1.21.x - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 + + - name: Run Go Releaser + uses: goreleaser/goreleaser-action@v5 with: distribution: goreleaser version: latest - args: release --rm-dist -p 1 + args: release --clean -p 1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} + + container-release: + name: Container Release Job + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set Up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and Push to GitHub Container Registry + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64,linux/arm64,darwin/amd64,darwin/arm64,windows/amd64,windows/arm64 + push: true + tags: ${{ github.repository_owner }}/${{ github.repository }}:${{ github.ref_name }},${{ github.repository_owner }}/${{ github.repository }}}:latest From f147d7c73e6f2b710dcc9c350466ef49202cc3ff Mon Sep 17 00:00:00 2001 From: Zack Hodgson Brady Date: Fri, 5 Apr 2024 18:52:52 -0400 Subject: [PATCH 3/3] fixed workflow typo --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9a33c24b..54c96df4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -61,4 +61,4 @@ jobs: context: . platforms: linux/amd64,linux/arm64,darwin/amd64,darwin/arm64,windows/amd64,windows/arm64 push: true - tags: ${{ github.repository_owner }}/${{ github.repository }}:${{ github.ref_name }},${{ github.repository_owner }}/${{ github.repository }}}:latest + tags: ${{ github.repository_owner }}/${{ github.repository }}:${{ github.ref_name }},${{ github.repository_owner }}/${{ github.repository }}:latest