-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: scope the CI and add QoL improvements #3316
base: master
Are you sure you want to change the base?
Changes from all commits
19b9336
a48cb2c
3b70e12
fba9234
6027a08
782b78c
32b8e22
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ codecov: | |
wait_for_ci: true | ||
|
||
comment: | ||
require_changes: false | ||
require_changes: true | ||
|
||
coverage: | ||
round: down | ||
|
@@ -13,7 +13,7 @@ coverage: | |
project: | ||
default: | ||
target: auto | ||
threshold: 10 # Let's decrease this later. | ||
threshold: 5 # Let's decrease this later. | ||
base: parent | ||
if_no_uploads: error | ||
if_not_found: success | ||
|
@@ -22,12 +22,12 @@ coverage: | |
patch: | ||
default: | ||
target: auto | ||
threshold: 10 # Let's decrease this later. | ||
threshold: 5 # Let's decrease this later. | ||
base: auto | ||
if_no_uploads: error | ||
if_not_found: success | ||
if_ci_failed: error | ||
only_pulls: false | ||
only_pulls: true # Only check patch coverage on PRs | ||
|
||
flag_management: | ||
default_rules: | ||
|
@@ -40,6 +40,55 @@ flag_management: | |
target: auto # Let's decrease this later. | ||
threshold: 10 | ||
|
||
groups: | ||
gno-land: | ||
paths: | ||
- "gno.land/**" | ||
flags: | ||
- gno-land | ||
gnovm: | ||
paths: | ||
- "gnovm/**" | ||
flags: | ||
- gnovm | ||
misc: | ||
paths: | ||
- "misc/**" | ||
flags: | ||
- misc | ||
tm2: | ||
paths: | ||
- "tm2/**" | ||
flags: | ||
- tm2 | ||
contribs: | ||
paths: | ||
- "contribs/**" | ||
flags: | ||
- contribs | ||
|
||
statuses: | ||
- type: project | ||
flag: gno-land | ||
target: auto | ||
threshold: 5 | ||
- type: project | ||
flag: gnovm | ||
target: auto | ||
threshold: 2 # Stricter threshold | ||
- type: project | ||
flag: misc | ||
target: auto | ||
threshold: 10 | ||
- type: project | ||
flag: tm2 | ||
target: auto | ||
threshold: 5 | ||
- type: project | ||
flag: contribs | ||
target: auto | ||
threshold: 5 | ||
Comment on lines
+70
to
+90
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we want to change thresholds depending on the flag? Is it really necessary? |
||
|
||
ignore: | ||
- "gnovm/stdlibs/generated.go" | ||
- "gnovm/tests/stdlibs/generated.go" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,9 +44,11 @@ linters: | |
linters-settings: | ||
gofmt: | ||
simplify: true | ||
|
||
goconst: | ||
min-len: 3 | ||
min-occurrences: 3 | ||
|
||
gosec: | ||
excludes: | ||
- G204 # Subprocess launched with a potential tainted input or cmd arguments | ||
|
@@ -56,24 +58,27 @@ linters-settings: | |
checks: [ "all", "-ST1022", "-ST1003" ] | ||
errorlint: | ||
asserts: false | ||
|
||
gocritic: | ||
enabled-tags: | ||
- diagnostic | ||
- experimental | ||
- opinionated | ||
- performance | ||
- style | ||
|
||
forbidigo: | ||
forbid: | ||
- p: '^regexp\.(Match|MatchString)$' | ||
msg: it will re-compile the regexp for each execution; compile the regexp with regexp.Compile and store it as a singleton | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. iirc the error message came out better written out (in context) as I wrote it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
msg: "Use compiled regex via regexp.Compile and store as a singleton" | ||
|
||
issues: | ||
whole-files: true | ||
max-issues-per-linter: 0 | ||
max-same-issues: 0 | ||
new: false | ||
fix: false | ||
|
||
exclude-rules: | ||
- path: _test\.go | ||
linters: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: auto-author-assign | ||
name: Auto Assign PR Author | ||
|
||
on: | ||
pull_request_target: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't we test building it? do we use it in any deployment? |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: run benchmarks when pushing on main branch | ||
name: Run and Save Benchmarks | ||
|
||
on: | ||
push: | ||
|
@@ -9,6 +9,7 @@ on: | |
- gno.land/** | ||
- gnovm/** | ||
- tm2/** | ||
- '**/*.go' | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is making previous filters unnecessary. |
||
permissions: | ||
# deployments permission to deploy GitHub pages website | ||
|
@@ -22,7 +23,7 @@ env: | |
jobs: | ||
benchmarks: | ||
if: ${{ github.repository == 'gnolang/gno' }} | ||
runs-on: [self-hosted, Linux, X64, benchmarks] | ||
runs-on: [ self-hosted, Linux, X64, benchmarks ] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
name: contribs | ||
name: Contribs CI Suite | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
pull_request: | ||
paths: | ||
- contribs/** | ||
workflow_dispatch: | ||
|
||
jobs: | ||
setup: | ||
|
@@ -19,12 +21,13 @@ jobs: | |
main: | ||
needs: setup | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
program: ${{ fromJson(needs.setup.outputs.programs) }} | ||
fail-fast: false | ||
matrix: | ||
program: ${{ fromJson(needs.setup.outputs.programs) }} | ||
name: Run Main | ||
uses: ./.github/workflows/main_template.yml | ||
with: | ||
modulepath: contribs/${{ matrix.program }} | ||
go-version: "1.22.x" | ||
secrets: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. moving go version outside the main template is making it scattered around more than before... |
||
codecov-token: ${{ secrets.CODECOV_TOKEN }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
name: "docs / lint" | ||
name: Docs Linter | ||
|
||
on: | ||
push: | ||
paths: | ||
branches: | ||
- master | ||
pull_request: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lol |
||
paths: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
name: examples | ||
name: Gno Examples CI Suite | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep this one short; "CI suite" is redundant. I like "Test Examples" |
||
on: | ||
pull_request: | ||
push: | ||
branches: ["master"] | ||
branches: | ||
- master | ||
pull_request: | ||
paths: | ||
- gnovm/**/*.gno | ||
- examples/**/*.gno | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
|
@@ -67,26 +71,23 @@ jobs: | |
# TODO: consider running lint on every other directories, maybe in "warning" mode? | ||
# TODO: track coverage | ||
fmt: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
goversion: ["1.22.x"] | ||
name: Run gno fmt | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
- name: gno fmt | ||
uses: ./.github/workflows/gnofmt_template.yml | ||
with: | ||
go-version: ${{ matrix.goversion }} | ||
- run: | | ||
make fmt -C ./examples | ||
# Check if there are changes after running make fmt | ||
path: "examples/..." | ||
go-version: "1.22.x" | ||
- name: Check for unformatted gno files | ||
run: | | ||
git diff --exit-code || (echo "Some gno files are not formatted, please run 'make fmt'." && exit 1) | ||
|
||
mod-tidy: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
go-version: ["1.22.x"] | ||
go-version: [ "1.22.x" ] | ||
# unittests: TODO: matrix with contracts | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flags are already automatically defined here: https://github.com/gnolang/gno/pull/3316/files#diff-a8d8d916d02d13f09d2a0128a4667158fdd150a4e354d0c7a9cde6a8479b3dc5R68 so no need to define them here.