Skip to content

Commit

Permalink
feat: merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
MikaelVallenet committed Dec 26, 2024
2 parents ed8b686 + ea32315 commit 19f2ee8
Show file tree
Hide file tree
Showing 863 changed files with 35,221 additions and 9,496 deletions.
8 changes: 8 additions & 0 deletions .github/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Make sure this is the top-level editorconfig
# https://editorconfig.org/
root = true

# GitHub Actions Workflows
[workflows/**.yml]
indent_style = space
indent_size = 2
8 changes: 4 additions & 4 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ codecov:
wait_for_ci: true

comment:
require_changes: false
require_changes: true

coverage:
round: down
Expand All @@ -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
Expand All @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions .github/golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,29 @@ 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
- G306 # Expect WriteFile permissions to be 0600 or less
- G115 # Integer overflow conversion, no solution to check the overflow in time of convert, so linter shouldn't check the overflow.
stylecheck:
checks: [ "all", "-ST1022", "-ST1003" ]
errorlint:
asserts: false

gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style

forbidigo:
forbid:
- p: '^regexp\.(Match|MatchString)$'
Expand All @@ -73,6 +78,7 @@ issues:
max-same-issues: 0
new: false
fix: false

exclude-rules:
- path: _test\.go
linters:
Expand Down
103 changes: 73 additions & 30 deletions .github/goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
project_name: gno
version: 2

Expand Down Expand Up @@ -86,6 +87,8 @@ builds:
goarm:
- "6"
- "7"
# Gno Contribs
# NOTE: Contribs binary will be added in a single docker image below: gnocontribs
- id: gnobro
dir: ./contribs/gnodev/cmd/gnobro
binary: gnobro
Expand All @@ -101,6 +104,21 @@ builds:
goarm:
- "6"
- "7"
- id: gnogenesis
dir: ./contribs/gnogenesis
binary: gnogenesis
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- amd64
- arm64
- arm
goarm:
- "6"
- "7"

gomod:
proxy: true
Expand Down Expand Up @@ -300,6 +318,7 @@ dockers:
- gno.land/genesis/genesis_txs.jsonl
- examples
- gnovm/stdlibs

# gnokey
- use: buildx
dockerfile: Dockerfile.release
Expand Down Expand Up @@ -504,73 +523,97 @@ dockers:
ids:
- gnofaucet

# gnobro
# gnocontribs
- use: buildx
dockerfile: Dockerfile.release
goos: linux
goarch: amd64
image_templates:
- "ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }}-amd64"
- "ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }}-amd64"
- "ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}-amd64"
- "ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}-amd64"
build_flag_templates:
- "--target=gnobro"
- "--target=gnocontribs"
- "--platform=linux/amd64"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}/gnobro"
- "--label=org.opencontainers.image.title={{.ProjectName}}/gnocontribs"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
ids:
- gnobro
- gnogenesis
extra_files:
- gno.land/genesis/genesis_balances.txt
- gno.land/genesis/genesis_txs.jsonl
- examples
- gnovm/stdlibs
- use: buildx
dockerfile: Dockerfile.release
goos: linux
goarch: arm64
image_templates:
- "ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }}-arm64v8"
- "ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }}-arm64v8"
- "ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}-arm64v8"
- "ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}-arm64v8"
build_flag_templates:
- "--target=gnobro"
- "--target=gnocontribs"
- "--platform=linux/arm64/v8"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}/gnobro"
- "--label=org.opencontainers.image.title={{.ProjectName}}/gnocontribs"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
ids:
- gnobro
- gnogenesis
extra_files:
- gno.land/genesis/genesis_balances.txt
- gno.land/genesis/genesis_txs.jsonl
- examples
- gnovm/stdlibs
- use: buildx
dockerfile: Dockerfile.release
goos: linux
goarch: arm
goarm: 6
image_templates:
- "ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }}-armv6"
- "ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }}-armv6"
- "ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}-armv6"
- "ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}-armv6"
build_flag_templates:
- "--target=gnobro"
- "--target=gnocontribs"
- "--platform=linux/arm/v6"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}/gnobro"
- "--label=org.opencontainers.image.title={{.ProjectName}}/gnocontribs"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
ids:
- gnobro
- gnogenesis
extra_files:
- gno.land/genesis/genesis_balances.txt
- gno.land/genesis/genesis_txs.jsonl
- examples
- gnovm/stdlibs
- use: buildx
dockerfile: Dockerfile.release
goos: linux
goarch: arm
goarm: 7
image_templates:
- "ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }}-armv7"
- "ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }}-armv7"
- "ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}-armv7"
- "ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}-armv7"
build_flag_templates:
- "--target=gnobro"
- "--target=gnocontribs"
- "--platform=linux/arm/v7"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}/gnobro"
- "--label=org.opencontainers.image.title={{.ProjectName}}/gnocontribs"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
ids:
- gnobro
- gnogenesis
extra_files:
- gno.land/genesis/genesis_balances.txt
- gno.land/genesis/genesis_txs.jsonl
- examples
- gnovm/stdlibs

docker_manifests:
# https://goreleaser.com/customization/docker_manifest/
Expand Down Expand Up @@ -645,19 +688,19 @@ docker_manifests:
- ghcr.io/gnolang/{{ .ProjectName }}/gnofaucet:{{ .Env.TAG_VERSION }}-armv6
- ghcr.io/gnolang/{{ .ProjectName }}/gnofaucet:{{ .Env.TAG_VERSION }}-armv7

# gnobro
- name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }}
image_templates:
- ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }}-amd64
- ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }}-arm64v8
- ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }}-armv6
- ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Version }}-armv7
- name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }}
image_templates:
- ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }}-amd64
- ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }}-arm64v8
- ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }}-armv6
- ghcr.io/gnolang/{{ .ProjectName }}/gnobro:{{ .Env.TAG_VERSION }}-armv7
# gnocontribs
- name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}
image_templates:
- ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}-amd64
- ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}-arm64v8
- ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}-armv6
- ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Version }}-armv7
- name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}
image_templates:
- ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}-amd64
- ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}-arm64v8
- ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}-armv6
- ghcr.io/gnolang/{{ .ProjectName }}/gnocontribs:{{ .Env.TAG_VERSION }}-armv7

docker_signs:
- cmd: cosign
Expand Down
11 changes: 0 additions & 11 deletions .github/pull_request_template.md

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/auto-author-assign.yml
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:
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/autocounterd.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
name: autocounterd
name: Portal Loop - autocounterd

on:
pull_request:
branches:
- master
push:
branches:
- "master"
paths:
- misc/autocounterd
- misc/loop
- .github/workflows/autocounterd.yml
branches:
- "master"
- "misc/autocounterd"
tags:
- "v*"

permissions:
contents: read
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/benchmark-master-push.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: run benchmarks when pushing on main branch
name: Run and Save Benchmarks

on:
push:
branches:
- master
paths:
- contribs/**
- gno.land/**
- gnovm/**
- tm2/**
- contribs/**/*.go
- gno.land/**/*.go
- gnovm/**/*.go
- tm2/**/*.go

permissions:
# deployments permission to deploy GitHub pages website
Expand All @@ -22,7 +22,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
Expand All @@ -31,7 +31,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: "1.22.x"
go-version-file: go.mod

- name: Run benchmark
# add more benchmarks by adding additional lines for different packages;
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/bot-proxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This workflow must be kept in sync to some extent with bot.yml
name: GitHub Bot Proxy

on:
# Watch for any completed run on bot.yml workflow
workflow_run:
workflows: [GitHub Bot]
types: [completed]

jobs:
# This workflow monitors any run completed on the GitHub Bot workflow and
# checks if the event that triggered it is limited to read-only permissions
# (e.g 'pull_request_review' on a pull request opened from a fork).
# In this case, it reruns the GitHub Bot workflow using a 'workflow_dispatch'
# event, thereby allowing it to run with write permissions.
#
# Complete flow:
# 'pull_request_review' from fork on bot.yml (read-only) -> 'workflow_run' on bot-proxy.yml (write) -> 'workflow_dispatch' on bot.yml (write)
rerun-with-write-perm:
name: Rerun Bot with write permission
# Skip this workflow if the original event is not 'pull_request_review'
if: github.event.workflow_run.event == 'pull_request_review'
runs-on: ubuntu-latest
permissions:
actions: write

steps:
- name: Download artifact from previous run
uses: actions/download-artifact@v4
with:
name: pr-number
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
# Even if the artifact doesn't exist, do not mark the workflow as failed
# Useful if the 'pull_request_review' event was emitted by a PR opened
# from a branch on the main repo, so it has already been processed by
# the bot workflow, and no artifact has been uploaded.
continue-on-error: true
id: download

- name: Send workflow_dispatch event to Github Bot
# Run only if an artifact was downloaded
if: steps.download.outcome == 'success'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.event.workflow_run.repository.full_name }}
run: |
gh workflow run bot.yml -R "$REPO" -f "pull-request-list=$(cat pr-number)"
Loading

0 comments on commit 19f2ee8

Please sign in to comment.