diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index adf0490..72d2561 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 + golang-ci: + 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 96e11bf..0e260e0 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/golang-workflows/.github/workflows/golang-release.yml@v1.0.0 + secrets: + token: ${{ secrets.GITHUB_TOKEN }} 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