diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c435c73e..24cdfbdd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,7 +35,7 @@ # - name: Set up Go # uses: actions/setup-go@v3 # with: -# go-version: 1.20.x +# go-version-file: go.mod # - name: Run the roller installation script # run: | # [ -f ~/.zshrc ] && source ~/.zshrc diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index f16da623..92fb64f5 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -3,20 +3,19 @@ on: workflow_dispatch: jobs: end_to_end_test: - runs-on: [ "arm-linux" ] + runs-on: ["arm-linux"] env: GOPRIVATE: "github.com/dymensionxyz/*" GH_ACCESS_TOKEN: "${{ secrets.GH_ACCESS_TOKEN }}" - ROLLER_CONFIG_PATH: "${{ github.workspace }}/tmp/e2e_roller_config" # Setting the environment variable + ROLLER_CONFIG_PATH: "${{ github.workspace }}/tmp/e2e_roller_config" # Setting the environment variable ROLLAPP_ID: "endtoend_1-${{ github.run_number }}" steps: - uses: actions/checkout@v3 - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.19.10 + go-version-file: go.mod - run: git config --global url.https://$GH_ACCESS_TOKEN@github.com/.insteadOf https://github.com/ - - name: Init a local rollapp within screen run: | # Start a new detached screen session named "rollapp_init" @@ -32,7 +31,6 @@ jobs: # Kill the screen session after the command is done screen -S rollapp_init -X quit - - name: Run the local hub run: | screen -dmS hub-session /usr/local/bin/dymd start --home "$ROLLER_CONFIG_PATH/local-hub" @@ -40,7 +38,6 @@ jobs: HUB_PID=$(pgrep -f 'dymd start --home' | head -n 1) echo "Captured PID: $HUB_PID" echo "HUB_PID=$HUB_PID" >> $GITHUB_ENV - - name: Fund the RollApp addresses run: | HUB_SEQ_ADDR=$(go run . keys list --home $ROLLER_CONFIG_PATH --output json | jq -r '.hub_sequencer') @@ -48,21 +45,17 @@ jobs: RELAYER_ROLLAPP_ADDR=$(go run . keys list --home $ROLLER_CONFIG_PATH --output json | jq -r '."relayer-hub-key"') /usr/local/bin/dymd tx bank multi-send local-user $HUB_SEQ_ADDR $RELAYER_ROLLAPP_ADDR 1adym --yes -b block --keyring-backend test --home $ROLLER_CONFIG_PATH/local-hub --node http://127.0.0.1:36657 sleep 10 - - name: Register the rollapp run: | go run . tx register --home $ROLLER_CONFIG_PATH --no-output - - name: Run the rollapp run: | go run . run --home $ROLLER_CONFIG_PATH --no-output & echo "ROLLAPP_PID=$!" >> $GITHUB_ENV - - name: Execute IBC relay tester run: | chmod +x ./scripts/ibc_relay_tester.sh DEST_ADDR=$HUB_SEQ_ADDR ROLLAPP_ID=$ROLLAPP_ID ROLLER_CONFIG_PATH=$ROLLER_CONFIG_PATH ./scripts/ibc_relay_tester.sh 2> script_errors.log - - name: Terminate the rollapp if: always() run: | diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 82aee373..243939ef 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -5,7 +5,15 @@ on: - v* branches: - main + paths: + - '**/*.go' + - go.mod + - go.sum pull_request: + paths: + - '**/*.go' + - go.mod + - go.sum jobs: golangci-lint: name: lint @@ -14,23 +22,14 @@ jobs: GOPRIVATE: "github.com/dymensionxyz/*" GH_ACCESS_TOKEN: "${{ secrets.GH_ACCESS_TOKEN }}" steps: - - uses: actions/setup-go@v4 - with: - go-version: "1.21" - run: git config --global url.https://$GH_ACCESS_TOKEN@github.com/.insteadOf https://github.com/ - uses: actions/checkout@v3 + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version version: v1.59.1 only-new-issues: true - markdownlint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: markdownlint-cli - uses: nosborn/github-action-markdown-cli@v3.2.0 - with: - files: . - config-file: .markdownlint.yaml diff --git a/.github/workflows/markdownlint.yaml b/.github/workflows/markdownlint.yaml new file mode 100644 index 00000000..babd5f2d --- /dev/null +++ b/.github/workflows/markdownlint.yaml @@ -0,0 +1,18 @@ +name: Linters +on: + push: + paths: + - '**/*.md' + pull_request: + paths: + - '**/*.md' +jobs: + markdownlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: markdownlint-cli + uses: nosborn/github-action-markdown-cli@v3.2.0 + with: + files: . + config-file: .markdownlint.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 978f7cd4..840151e7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -41,7 +41,7 @@ jobs: with: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 if: steps.release-please.outputs.release_created with: go-version-file: go.mod @@ -51,10 +51,11 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 if: steps.release-please.outputs.release_created + # TODO: handle GCP, AWS, GitHub, Docker Hub and Azure container registries - name: Run GoReleaser - release binaries - uses: goreleaser/goreleaser-action@v3 + uses: goreleaser/goreleaser-action@v6 with: - args: release --rm-dist --config .goreleaser.yaml --debug + args: release --clean --config .goreleaser.yaml env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GOPRIVATE: github.com/${{ env.GITHUB_REPOSITORY_OWNER }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ae94ad5f..d49f317e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.22 + go-version-file: go.mod - run: git config --global url.https://$GH_ACCESS_TOKEN@github.com/.insteadOf https://github.com/ - name: Build run: make build diff --git a/.golangci.yml b/.golangci.yml index 4051c551..365265c0 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -3,6 +3,7 @@ run: timeout: 5m tests: true modules-download-mode: readonly + go: "1.22.4" output: # Format: colored-line-number|line-number|json|colored-tab|tab|checkstyle|code-climate|junit-xml|github-actions|teamcity # @@ -52,7 +53,7 @@ issues: - "^.*SA1019.*$" # Excluding SA1019 errors linters-settings: go-version-checker: - min-version: "1.22" + min-version: "1.22.4" revive: rules: - name: exported diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 8ccb8253..d5adcd19 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,3 +1,4 @@ +version: 2 project_name: roller before: hooks: @@ -16,7 +17,6 @@ builds: - amd64 - arm64 changelog: - skip: false use: git groups: - title: Features diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8f142b01..3c294210 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,27 +2,35 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.2.0 + rev: v4.5.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - id: check-added-large-files - repo: https://github.com/golangci/golangci-lint - rev: v1.51.2 + rev: v1.59.1 hooks: - id: golangci-lint - repo: https://github.com/compilerla/conventional-pre-commit - rev: v2.1.1 + rev: v3.2.0 hooks: - id: conventional-pre-commit stages: [commit-msg] args: [feat, fix, ci, chore, test, docs] # optional: list of Conventional Commits types to allow e.g. [feat, fix, ci, chore, test] + - repo: local + hooks: + - id: goimports-reviser + name: go imports reviser + entry: goimports-reviser -format -recursive + language: golang + types: [go] + files: \.go$ - repo: local hooks: - id: golines name: golines - entry: golines --max-len=100 + entry: golines --max-len=100 -w language: golang types: [go] files: \.go$