From 99194c81d6ec2e4e5dab29bf37b54c8e8d608755 Mon Sep 17 00:00:00 2001 From: Jonathan Seth Mainguy Date: Sun, 15 Sep 2024 12:09:00 -0400 Subject: [PATCH 1/4] chore: use reusable workflow --- .github/workflows/push.yml | 63 +++----------------------------------- tests/fmtlint.sh | 12 -------- 2 files changed, 5 insertions(+), 70 deletions(-) delete mode 100755 tests/fmtlint.sh diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index adf0490..b80b460 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -1,61 +1,8 @@ +name: Call Reusable Golang CI Workflow + on: - push: + push: -name: push jobs: - golangci: - name: lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 - - name: golangci-lint - uses: golangci/golangci-lint-action@v6 - test: - name: Test with Coverage - runs-on: ubuntu-latest - steps: - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: '1.21' - - - name: Get Build Tools - run: | - go install github.com/ory/go-acc@latest - - - name: git checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 - - - name: Install dependencies - run: | - go mod download - - - name: Run Unit tests - run: | - go-acc . - - - name: Send coverage - uses: shogo82148/actions-goveralls@v1 - with: - path-to-profile: coverage.txt - - build: - name: Lint and build - runs-on: ubuntu-latest - steps: - - name: install go - uses: actions/setup-go@v5 - with: - go-version: '1.21' - - - name: git checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 - - - name: install lint - run: GO111MODULE=off go get golang.org/x/lint/golint - - - name: run golint and go fmt - run: ./tests/fmtlint.sh - - - name: go build - run: go build + call-workflow: + uses: Jmainguy/workflows/.github/workflows/golang-ci.yml@testing diff --git a/tests/fmtlint.sh b/tests/fmtlint.sh deleted file mode 100755 index fb464ff..0000000 --- a/tests/fmtlint.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -FormatCheck=$(gofmt -l *.go | wc -l) -if [ $FormatCheck -gt 0 ]; then - gofmt -l *.go - echo "gofmt -w *.go your code please." - exit 1 -fi -## Run golint -golint -set_exit_status -if [ $? -gt 0 ]; then - exit 1 -fi From b5c28854cbabebf084f40ae2effd245d9b5f4b76 Mon Sep 17 00:00:00 2001 From: Jonathan Seth Mainguy Date: Sun, 15 Sep 2024 12:11:50 -0400 Subject: [PATCH 2/4] chore: rename workflow --- .github/workflows/push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index b80b460..bdcf0b3 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -4,5 +4,5 @@ on: push: jobs: - call-workflow: + golang-ci: uses: Jmainguy/workflows/.github/workflows/golang-ci.yml@testing From 09cd9efe12f9134fdf0532752f6a50f9a989e976 Mon Sep 17 00:00:00 2001 From: Jonathan Seth Mainguy Date: Sun, 15 Sep 2024 12:17:08 -0400 Subject: [PATCH 3/4] chore: update release to use reusable workflow --- .github/workflows/release-please.yaml | 33 ++++----------------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml index 96e11bf..f1e34bf 100644 --- a/.github/workflows/release-please.yaml +++ b/.github/workflows/release-please.yaml @@ -1,4 +1,4 @@ -name: release-please +name: Call Reusable Golang Release-Please Workflow on: push: @@ -7,31 +7,6 @@ on: jobs: release-please: - runs-on: ubuntu-latest - outputs: - release_created: ${{ steps.release-please.outputs.release_created }} - steps: - - uses: google-github-actions/release-please-action@v4 - id: release-please - with: - release-type: go - - release: - runs-on: ubuntu-latest - needs: release-please - if: needs.release-please.outputs.release_created - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 - with: - fetch-depth: 0 - - run: git fetch --force --tags - - uses: actions/setup-go@v5 - with: - go-version: "1.21" - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v6 - with: - version: latest - args: release --clean - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: Jmainguy/workflows/.github/workflows/golang-release.yml@testing + secrets: + token: ${{ secrets.GITHUB_TOKEN }} From 68754df4c78019f8f7079007efbd4fb421580593 Mon Sep 17 00:00:00 2001 From: Jonathan Seth Mainguy Date: Mon, 16 Sep 2024 13:10:33 -0400 Subject: [PATCH 4/4] chore: use re-usable workflows --- .github/workflows/push.yml | 2 +- .github/workflows/release-please.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index bdcf0b3..72d2561 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -5,4 +5,4 @@ on: jobs: golang-ci: - uses: Jmainguy/workflows/.github/workflows/golang-ci.yml@testing + uses: Jmainguy/golang-workflows/.github/workflows/golang-ci.yml@v1.0.0 diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml index f1e34bf..0e260e0 100644 --- a/.github/workflows/release-please.yaml +++ b/.github/workflows/release-please.yaml @@ -7,6 +7,6 @@ on: jobs: release-please: - uses: Jmainguy/workflows/.github/workflows/golang-release.yml@testing + uses: Jmainguy/golang-workflows/.github/workflows/golang-release.yml@v1.0.0 secrets: token: ${{ secrets.GITHUB_TOKEN }}