From 4fa2651db6dbc5ff20a55bafa59f1fe94351b3c1 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 12 Dec 2025 22:54:13 +0100 Subject: [PATCH] feat: add good default ci jobs --- changelog.md | 3 ++- .../app/files/.github/workflows/go-unit.yml | 17 +++++++++++++ .../app/files/.github/workflows/lint-pr.yml | 19 ++++++++++++++ .../app/files/.github/workflows/lint.yml | 25 +++++++++++++++++++ 4 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 ignite/templates/app/files/.github/workflows/go-unit.yml create mode 100644 ignite/templates/app/files/.github/workflows/lint-pr.yml create mode 100644 ignite/templates/app/files/.github/workflows/lint.yml diff --git a/changelog.md b/changelog.md index 86dd6db3b9..208142df8e 100644 --- a/changelog.md +++ b/changelog.md @@ -4,7 +4,8 @@ ## Changes -- []() Bump `cosmos-sdk` version to `v0.53.5` and minimum Go version to `1.25`. +- [#4850](https://github.com/ignite/cli/pull/4850) Add default GitHub Actions for linting and testing. +- [#4849](https://github.com/ignite/cli/pull/4849) Bump `cosmos-sdk` version to `v0.53.5` and minimum Go version to `1.25`. ## [`v29.6.2`](https://github.com/ignite/cli/releases/tag/v29.6.2) diff --git a/ignite/templates/app/files/.github/workflows/go-unit.yml b/ignite/templates/app/files/.github/workflows/go-unit.yml new file mode 100644 index 0000000000..8a6a38088c --- /dev/null +++ b/ignite/templates/app/files/.github/workflows/go-unit.yml @@ -0,0 +1,17 @@ +name: Unit tests +on: + pull_request: +jobs: + tests: + runs-on: ubuntu-latest + steps: + - name: Check out source + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "stable" + check-latest: true + - name: Tests + run: | + make test diff --git a/ignite/templates/app/files/.github/workflows/lint-pr.yml b/ignite/templates/app/files/.github/workflows/lint-pr.yml new file mode 100644 index 0000000000..c670ab09a0 --- /dev/null +++ b/ignite/templates/app/files/.github/workflows/lint-pr.yml @@ -0,0 +1,19 @@ +name: Lint PR +on: + pull_request_target: + types: + - opened + - edited + - synchronize +permissions: + contents: read +jobs: + lint: + permissions: + pull-requests: read + statuses: write + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5.5.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/ignite/templates/app/files/.github/workflows/lint.yml b/ignite/templates/app/files/.github/workflows/lint.yml new file mode 100644 index 0000000000..6962cb227c --- /dev/null +++ b/ignite/templates/app/files/.github/workflows/lint.yml @@ -0,0 +1,25 @@ +name: Lint +on: + pull_request: + paths: + - "**/*.go" + - "go.mod" + - "go.sum" + - "**/go.mod" + - "**/go.sum" + merge_group: +permissions: + contents: read +jobs: + golangci: + name: golangci-lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: "stable" + check-latest: true + - name: run linting + run: | + make lint