feat: implement gno mod tidy
#3058
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: examples | |
on: | |
pull_request: | |
paths: | |
- "go.sum" | |
- "gnovm/**.go" | |
- "gnovm/**.gno" | |
- "gnovm/**/go.sum" | |
- "examples/**.gno" | |
- ".github/workflows/examples.yml" | |
push: | |
branches: [ "master" ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
gno2go: | |
strategy: | |
fail-fast: false | |
matrix: | |
goversion: | |
- "1.20.x" | |
- "1.21.x" | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.goversion }} | |
- run: go install -v ./gnovm/cmd/gno | |
- run: go run ./gnovm/cmd/gno precompile --verbose ./examples | |
- run: go run ./gnovm/cmd/gno build --verbose ./examples | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
goversion: | |
- "1.20.x" | |
- "1.21.x" | |
# unittests: TODO: matrix with contracts | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.goversion }} | |
- run: go install -v ./gnovm/cmd/gno | |
- run: go run ./gnovm/cmd/gno test --verbose ./examples/... | |
lint: | |
strategy: | |
fail-fast: false | |
matrix: | |
goversion: | |
- "1.20.x" | |
- "1.21.x" | |
# unittests: TODO: matrix with contracts | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.goversion }} | |
- run: go install -v ./gnovm/cmd/gno | |
# testing official directories, basically examples/ minus examples/.../x/. | |
- run: go run ./gnovm/cmd/gno lint --verbose ./examples/gno.land/p | |
- run: go run ./gnovm/cmd/gno lint --verbose ./examples/gno.land/r/demo | |
- run: go run ./gnovm/cmd/gno lint --verbose ./examples/gno.land/r/gnoland | |
- run: go run ./gnovm/cmd/gno lint --verbose ./examples/gno.land/r/system | |
# TODO: track coverage | |
mod-tidy: | |
strategy: | |
fail-fast: false | |
matrix: | |
go-version: [ "1.21.x" ] | |
# unittests: TODO: matrix with contracts | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- uses: actions/checkout@v3 | |
- run: | | |
GNO_CMD="$(pwd)/gnovm/cmd/gno" | |
# Find all directories containing gno.mod file | |
find ./examples -name "gno.mod" -execdir go run "$GNO_CMD" mod tidy \; | |
# Check if there are changes after running gno mod tidy | |
git diff --exit-code || (echo "Some gno.mod files are not tidy, please run 'make tidy'." && exit 1) |