diff --git a/.github/codecov.yml b/.github/codecov.yml index cd8860c3a68..65609743a74 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -1,7 +1,7 @@ codecov: require_ci_to_pass: false notify: - wait_for_ci: false + wait_for_ci: true ignore: - misc @@ -12,6 +12,25 @@ comment: coverage: round: down precision: 2 + status: + project: + default: + target: auto + threshold: 10 # Let's decrease this later. + base: parent + if_no_uploads: error + if_not_found: success + if_ci_failed: error + only_pulls: false + patch: + default: + target: auto + threshold: 100 # Allows PRs without tests, overall stats count. + base: auto + if_no_uploads: error + if_not_found: success + if_ci_failed: error + only_pulls: false flag_management: default_rules: @@ -19,9 +38,10 @@ flag_management: statuses: - type: project target: auto - threshold: 0.5% + threshold: 10 # Let's decrease this later. - type: patch - target: auto + target: auto # Allows PRs without tests, overall stats count. + threshold: 100 individual_flags: - name: tm2 paths: diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 8b8c6f618c5..63490c0bfa1 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -10,6 +10,7 @@ on: type: string jobs: benchmarks: + if: ${{ github.repository == 'gnolang/gno' }} runs-on: [self-hosted, Linux, X64, benchmark-v1] steps: - name: checkout diff --git a/.github/workflows/db-tests.yml b/.github/workflows/db-tests.yml index 081a7517725..f8da78cc3d8 100644 --- a/.github/workflows/db-tests.yml +++ b/.github/workflows/db-tests.yml @@ -20,7 +20,7 @@ jobs: strategy: fail-fast: false matrix: - go-version: + goversion: - "1.20.x" - "1.21.x" tags: @@ -29,10 +29,12 @@ jobs: - fsdb - boltdb steps: + - uses: actions/checkout@v4 + # golang - uses: actions/setup-go@v4 with: - go-version: ${{ matrix.go-version }} + go-version: ${{ matrix.goversion }} # leveldb - name: install leveldb @@ -46,6 +48,5 @@ jobs: sudo dpkg -i *.deb # test ./pkgs/db - - uses: actions/checkout@v4 - name: test ./tm2/pkg/db run: go test -tags ${{ matrix.tags }} ./tm2/pkg/db/... diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 4353682122a..d4b3079d612 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -21,16 +21,16 @@ jobs: strategy: fail-fast: false matrix: - go-version: + 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.go-version }} - - uses: actions/checkout@v4 + 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 @@ -38,34 +38,34 @@ jobs: strategy: fail-fast: false matrix: - go-version: + 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.go-version }} - - uses: actions/checkout@v4 + 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: - go-version: + 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.go-version }} - - uses: actions/checkout@v4 + 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 diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 2233132e745..8f57bec80a1 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -17,6 +17,7 @@ concurrency: jobs: build: + if: ${{ github.repository == 'gnolang/gno' }} # Alternatively, validate based on provided tokens and permissions. runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -30,6 +31,7 @@ jobs: path: ./misc/gendocs/godoc deploy: + if: ${{ github.repository == 'gnolang/gno' }} # Alternatively, validate based on provided tokens and permissions. runs-on: ubuntu-latest environment: name: github-pages diff --git a/.github/workflows/gnoland.yml b/.github/workflows/gnoland.yml index 902d0f41954..9fdfa3011cc 100644 --- a/.github/workflows/gnoland.yml +++ b/.github/workflows/gnoland.yml @@ -9,6 +9,12 @@ on: - "tm2/**.go" - "gno.land/**" - ".github/workflows/gnovm.yml" + # Until the codecov issue is resolved, it's essential to run the tests for gnovm, tm2, and gno.land concurrently. + - "gnovm/**" + - "tm2/**" + - "gno.land/**" + - "examples/**" + - ".github/workflows/**" push: branches: [ "master" ] @@ -21,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - go-version: + goversion: - "1.20.x" - "1.21.x" goarch: [ "amd64" ] @@ -35,10 +41,10 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 steps: + - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: - go-version: ${{ matrix.go-version }} - - uses: actions/checkout@v4 + go-version: ${{ matrix.goversion }} - name: go install working-directory: gno.land run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go install ./cmd/${{ matrix.program }} @@ -47,7 +53,7 @@ jobs: strategy: fail-fast: false matrix: - go-version: + goversion: - "1.20.x" - "1.21.x" args: @@ -58,25 +64,24 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 steps: + - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: - go-version: ${{ matrix.go-version }} - - uses: actions/checkout@v4 + go-version: ${{ matrix.goversion }} - name: test working-directory: gno.land run: | export GOPATH=$HOME/go export GOTEST_FLAGS="-v -p 1 -timeout=30m -coverprofile=coverage.out -covermode=atomic" make ${{ matrix.args }} - - if: runner.os == 'Linux' + - if: ${{ runner.os == 'Linux' && matrix.goversion == '1.21.x' }} uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} name: gno.land flags: gno.land-${{matrix.args}} files: ./gno.land/coverage.out - #fail_ci_if_error: ${{ github.repository == 'gnolang/gno' }} - fail_ci_if_error: false # temporarily + fail_ci_if_error: ${{ github.repository == 'gnolang/gno' }} docker-integration: strategy: diff --git a/.github/workflows/gnovm.yml b/.github/workflows/gnovm.yml index e545e4ac6db..034aa109767 100644 --- a/.github/workflows/gnovm.yml +++ b/.github/workflows/gnovm.yml @@ -11,6 +11,12 @@ on: - "gnovm/Makefile" - "tm2/**.go" - ".github/workflows/gnovm.yml" + # Until the codecov issue is resolved, it's essential to run the tests for gnovm, tm2, and gno.land concurrently. + - "gnovm/**" + - "tm2/**" + - "gno.land/**" + - "examples/**" + - ".github/workflows/**" push: branches: [ "master" ] @@ -23,7 +29,7 @@ jobs: strategy: fail-fast: false matrix: - go-version: # two latest versions + goversion: # two latest versions - "1.20.x" - "1.21.x" goenv: # TODO: replace with pairs, so it's easier to read in the GH interface. @@ -34,10 +40,10 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 steps: + - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: - go-version: ${{ matrix.go-version }} - - uses: actions/checkout@v4 + go-version: ${{ matrix.goversion }} - name: go install working-directory: gnovm run: ${{ matrix.goenv }} go install ./cmd/${{ matrix.program }} @@ -46,7 +52,7 @@ jobs: strategy: fail-fast: false matrix: - go-version: + goversion: - "1.20.x" - "1.21.x" args: @@ -62,22 +68,22 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 steps: + - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: - go-version: ${{ matrix.go-version }} - - uses: actions/checkout@v4 + go-version: ${{ matrix.goversion }} - name: test working-directory: gnovm run: | export GOPATH=$HOME/go export GOTEST_FLAGS="-v -p 1 -timeout=30m -coverprofile=coverage.out -covermode=atomic" make ${{ matrix.args }} - - if: runner.os == 'Linux' + - if: ${{ runner.os == 'Linux' && matrix.goversion == '1.21.x' }} uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} name: gnovm + verbose: true flags: gnovm-${{matrix.args}} files: ./gnovm/coverage.out - #fail_ci_if_error: ${{ github.repository == 'gnolang/gno' }} - fail_ci_if_error: false # temporarily + fail_ci_if_error: ${{ github.repository == 'gnolang/gno' }} diff --git a/.github/workflows/misc.yml b/.github/workflows/misc.yml index 7ece5b5158d..a7c20d61ffd 100644 --- a/.github/workflows/misc.yml +++ b/.github/workflows/misc.yml @@ -13,14 +13,14 @@ jobs: lint: runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Install Go uses: actions/setup-go@v4 with: go-version: 1.21.x - - name: Checkout code - uses: actions/checkout@v4 - - name: Lint uses: golangci/golangci-lint-action@v3 with: @@ -31,17 +31,17 @@ jobs: fmt: runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Install Go uses: actions/setup-go@v4 with: - go-version: 1.20.x + go-version: 1.21.x - name: Install make run: sudo apt-get install -y make - - name: Checkout code - uses: actions/checkout@v4 - # prefill dependencies so that mod messages don't show up in make output - name: Fetch dependencies run: go mod download -modfile ./misc/devdeps/go.mod -x @@ -61,13 +61,13 @@ jobs: modtidy: runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Install Go uses: actions/setup-go@v4 with: - go-version: 1.20.x - - - name: Checkout code - uses: actions/checkout@v4 + go-version: 1.21.x - name: Check go.mods run: | diff --git a/.github/workflows/tm2.yml b/.github/workflows/tm2.yml index 1be5bedc6c9..fc744ccc2ef 100644 --- a/.github/workflows/tm2.yml +++ b/.github/workflows/tm2.yml @@ -7,6 +7,12 @@ on: - "tm2/Makefile" - "tm2/**.go" - ".github/workflows/tm2.yml" + # Until the codecov issue is resolved, it's essential to run the tests for gnovm, tm2, and gno.land concurrently. + - "gnovm/**" + - "tm2/**" + - "gno.land/**" + - "examples/**" + - ".github/workflows/**" push: branches: [ "master" ] @@ -19,7 +25,7 @@ jobs: strategy: fail-fast: false matrix: - go-version: + goversion: - "1.20.x" - "1.21.x" goarch: [ "amd64" ] @@ -28,10 +34,10 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 steps: + - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: - go-version: ${{ matrix.go-version }} - - uses: actions/checkout@v4 + go-version: ${{ matrix.goversion }} - name: go install working-directory: tm2 run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go install ${{ matrix.program }} @@ -40,7 +46,7 @@ jobs: strategy: fail-fast: false matrix: - go-version: + goversion: - "1.20.x" - "1.21.x" args: @@ -51,22 +57,23 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 steps: + - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: - go-version: ${{ matrix.go-version }} - - uses: actions/checkout@v4 + go-version: ${{ matrix.goversion }} - name: test working-directory: tm2 run: | export GOPATH=$HOME/go export GOTEST_FLAGS="-v -p 1 -timeout=30m -coverprofile=coverage.out -covermode=atomic" make ${{ matrix.args }} - - if: runner.os == 'Linux' + touch coverage.out + - if: ${{ runner.os == 'Linux' && matrix.goversion == '1.21.x' }} uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} name: tm2 + verbose: true flags: tm2-${{matrix.args}} files: ./tm2/coverage.out - #fail_ci_if_error: ${{ github.repository == 'gnolang/gno' }} - fail_ci_if_error: false # temporarily + fail_ci_if_error: ${{ github.repository == 'gnolang/gno' }}