From cb0554c237fe1336d73108d61d7f24324ccd6049 Mon Sep 17 00:00:00 2001 From: Pantani Date: Thu, 28 Mar 2024 15:24:06 +0100 Subject: [PATCH] add missing workflows --- .github/workflows/auto-author-assign.yml | 18 +++++++++++++++ .github/workflows/cl-enforcer.yml | 19 ++++++++++++++++ .github/workflows/go-formatting.yml | 29 ++++++++++++++++++++++++ .github/workflows/janitor.yml | 16 +++++++++++++ .github/workflows/release-binary.yml | 6 +++-- .github/workflows/release-docker.yml | 4 ++-- .github/workflows/release-homebrew.yml | 2 +- .github/workflows/release-nightly.yml | 8 +++---- .github/workflows/release-snapcraft.yml | 6 +++-- .github/workflows/test-lint.yml | 3 ++- .github/workflows/test.yml | 2 +- changelog.md | 2 ++ 12 files changed, 102 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/auto-author-assign.yml create mode 100644 .github/workflows/cl-enforcer.yml create mode 100644 .github/workflows/go-formatting.yml create mode 100644 .github/workflows/janitor.yml diff --git a/.github/workflows/auto-author-assign.yml b/.github/workflows/auto-author-assign.yml new file mode 100644 index 0000000..8902a12 --- /dev/null +++ b/.github/workflows/auto-author-assign.yml @@ -0,0 +1,18 @@ +name: auto-author-assign + +on: + pull_request_target: + types: [ opened, reopened ] + +permissions: + pull-requests: write + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + assign-author: + runs-on: ubuntu-latest + steps: + - uses: toshimaru/auto-author-assign@v1.6.2 diff --git a/.github/workflows/cl-enforcer.yml b/.github/workflows/cl-enforcer.yml new file mode 100644 index 0000000..28117e6 --- /dev/null +++ b/.github/workflows/cl-enforcer.yml @@ -0,0 +1,19 @@ +name: Changelog Enforcer +on: + pull_request: + # The specific activity types are listed here to include "labeled" and "unlabeled" + # (which are not included by default for the "pull_request" trigger). + # This is needed to allow skipping enforcement of the changelog in PRs with specific labels, + # as defined in the (optional) "skipLabels" property. + types: [ opened, synchronize, reopened, ready_for_review, labeled, unlabeled ] + +jobs: + changelog: + runs-on: ubuntu-latest + steps: + - uses: dangoslen/changelog-enforcer@v3 + with: + changeLogPath: 'changelog.md' + missingUpdateErrorMessage: 'Please add an entry to the changelog.md file or add the "skip-changelog" label' + skipLabels: 'skip-changelog' + versionPattern: '' diff --git a/.github/workflows/go-formatting.yml b/.github/workflows/go-formatting.yml new file mode 100644 index 0000000..edce8de --- /dev/null +++ b/.github/workflows/go-formatting.yml @@ -0,0 +1,29 @@ +name: Go formatting +on: + push: + branches: [ main ] + paths: + - '**.go' + +jobs: + go-formatting: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install Go + uses: actions/setup-go@v4 + with: + go-version: '1.21' + + - name: Run make format + run: make format + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v3 + with: + title: "chore: go formatting" + commit-message: "chore: go formatting" + body: "" + branch: chore/go-formatting diff --git a/.github/workflows/janitor.yml b/.github/workflows/janitor.yml new file mode 100644 index 0000000..ecc2e48 --- /dev/null +++ b/.github/workflows/janitor.yml @@ -0,0 +1,16 @@ +name: Janitor +# Janitor cleans up previous runs that are not completed for a given workflow +# It cancels Sims and Tests +# Reference the API https://api.github.com/repos/:org/:repo/actions/workflows to find workflow ids +on: + pull_request: + +jobs: + cancel: + name: "Cancel Previous Runs" + runs-on: ubuntu-latest + timeout-minutes: 3 + steps: + - uses: styfle/cancel-workflow-action@0.11.0 + with: + access_token: ${{ github.token }} diff --git a/.github/workflows/release-binary.yml b/.github/workflows/release-binary.yml index d220d9d..6be16ce 100644 --- a/.github/workflows/release-binary.yml +++ b/.github/workflows/release-binary.yml @@ -2,7 +2,7 @@ name: Release Binaries on: release: - types: [published] + types: [ published ] concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} @@ -18,7 +18,9 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.21" + go-version: "1.22" + cache: true + cache-dependency-path: go.sum - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/release-docker.yml b/.github/workflows/release-docker.yml index 8570c82..455eef5 100644 --- a/.github/workflows/release-docker.yml +++ b/.github/workflows/release-docker.yml @@ -2,7 +2,7 @@ name: Release Docker Image on: release: - types: [published] + types: [ published ] schedule: - cron: "0 0 * * *" # every day at midnight @@ -34,7 +34,7 @@ jobs: name: Push Docker image to Docker Hub if: needs.check-latest-run.outputs.last_sha != github.sha runs-on: ubuntu-latest - needs: [consecutiveness, check-latest-run] + needs: [ consecutiveness, check-latest-run ] steps: - name: Check out the repo diff --git a/.github/workflows/release-homebrew.yml b/.github/workflows/release-homebrew.yml index c87eaaa..8a53986 100644 --- a/.github/workflows/release-homebrew.yml +++ b/.github/workflows/release-homebrew.yml @@ -2,7 +2,7 @@ name: Publish Gex to HomeBrew on: release: - types: [published] + types: [ published ] concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} diff --git a/.github/workflows/release-nightly.yml b/.github/workflows/release-nightly.yml index 49d52f2..2cd89e0 100644 --- a/.github/workflows/release-nightly.yml +++ b/.github/workflows/release-nightly.yml @@ -32,7 +32,7 @@ jobs: release-nightly: if: needs.check-latest-run.outputs.last_sha != github.sha runs-on: ubuntu-latest - needs: [consecutiveness, check-latest-run] + needs: [ consecutiveness, check-latest-run ] env: working-directory: go/src/github.com/ignite/gex @@ -64,12 +64,12 @@ jobs: releases-binaries: if: needs.check-latest-run.outputs.last_sha != github.sha name: Release Go Binary - needs: [consecutiveness, check-latest-run] + needs: [ consecutiveness, check-latest-run ] runs-on: ubuntu-latest strategy: matrix: - goos: [linux, darwin] - goarch: [amd64, arm64] + goos: [ linux, darwin ] + goarch: [ amd64, arm64 ] steps: - uses: actions/checkout@v4 - uses: wangyoucao577/go-release-action@v1.43 diff --git a/.github/workflows/release-snapcraft.yml b/.github/workflows/release-snapcraft.yml index 23802bc..2b8fcb2 100644 --- a/.github/workflows/release-snapcraft.yml +++ b/.github/workflows/release-snapcraft.yml @@ -2,7 +2,7 @@ name: Publish Gex to Snapcraft on: release: - types: [published] + types: [ published ] concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} @@ -16,7 +16,9 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.21" + go-version: "1.22" + cache: true + cache-dependency-path: go.sum - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/test-lint.yml b/.github/workflows/test-lint.yml index 5643dda..54ab9c1 100644 --- a/.github/workflows/test-lint.yml +++ b/.github/workflows/test-lint.yml @@ -32,7 +32,8 @@ jobs: if: env.GIT_DIFF with: go-version-file: go.mod - cache: false + cache: true + cache-dependency-path: go.sum - uses: golangci/golangci-lint-action@v4 if: env.GIT_DIFF diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6caad21..72e68ec 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,7 +33,7 @@ jobs: - uses: actions/setup-go@v5 if: env.GIT_DIFF with: - go-version: '1.21' + go-version: "1.22" cache: true cache-dependency-path: go.sum diff --git a/changelog.md b/changelog.md index 1ca0bac..eac1127 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,8 @@ ### Features +- [#1](https://github.com/ignite/gex/pull/1) Full refactor + ### Changes ### Fixes