Skip to content
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: Overhaul Github Actions #2040

Merged
merged 38 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
e39111b
WIP
ajnavarro May 6, 2024
7815942
All GH actions to workflows folder.
ajnavarro May 6, 2024
a6f597f
Fix template path
ajnavarro May 6, 2024
a1d5607
Fix golanci config path
ajnavarro May 6, 2024
2ad806b
Set working directory on golangci
ajnavarro May 6, 2024
bf3d765
Remove concurrency limitations
ajnavarro May 6, 2024
45be68e
Fix golangci path and remove unnecessary titles on main
ajnavarro May 6, 2024
e5beace
Improve tests and linter
ajnavarro May 6, 2024
efceca4
Set path-prefix on golangci
ajnavarro May 6, 2024
8eda61d
Install db deps
ajnavarro May 6, 2024
2d405ce
fix working directory for go generate
ajnavarro May 6, 2024
d09c5bf
Fix linter
ajnavarro May 6, 2024
d4847b3
Fix linter errors
ajnavarro May 6, 2024
8acc3e4
Install db deps when testing
ajnavarro May 6, 2024
df67ed7
Add contribs
ajnavarro May 6, 2024
e40ee34
Gnomod -> Gnomd
ajnavarro May 6, 2024
d1f874d
Bump codecov version
ajnavarro May 6, 2024
fa72182
attempt to fix issue with codecov
ajnavarro May 6, 2024
1902217
Move to codecov v3
ajnavarro May 6, 2024
9ab94dc
Pass secrets to templates
ajnavarro May 6, 2024
1109840
Simplify codecov config file
ajnavarro May 6, 2024
fb4f9c4
Properly set go version
ajnavarro May 6, 2024
6974446
Set go version strings
ajnavarro May 7, 2024
d74b3c8
Ignore some tests and keep dependabot logic
ajnavarro May 7, 2024
5ca38d5
Move contribs to a unique workflow to automatically add new ones in the
ajnavarro May 7, 2024
19e9735
Fix dependabot and update some gh actions
ajnavarro May 7, 2024
1d28a62
Refactor misc workflow
ajnavarro May 7, 2024
1bc47e5
Fix tests and linter on misc
ajnavarro May 7, 2024
1ddf9f0
Fix lint errors
ajnavarro May 7, 2024
dd0180c
fix linter errors
ajnavarro May 7, 2024
304c85f
Linter
ajnavarro May 7, 2024
4effca0
Add db deps to benchmarks
ajnavarro May 8, 2024
17b4814
Do not build docker images on PRs
ajnavarro May 8, 2024
560a5b2
Deactivate CGO in benchmarks
ajnavarro May 8, 2024
a1ef1d5
Ignore benchmarks causing parsing errors
ajnavarro May 8, 2024
9641fe9
Get back examples.yml and dependabot action groups
ajnavarro May 8, 2024
a3b01f4
Add comment explaining skip on benchmarks
ajnavarro May 8, 2024
d4ad4da
Fix typo
ajnavarro May 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 4 additions & 20 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
codecov:
require_ci_to_pass: false
require_ci_to_pass: true
notify:
wait_for_ci: true

ignore:
- misc

comment:
require_changes: false

Expand All @@ -25,7 +22,7 @@ coverage:
patch:
default:
target: auto
threshold: 100 # Allows PRs without tests, overall stats count.
threshold: 10 # Let's decrease this later.
base: auto
if_no_uploads: error
if_not_found: success
Expand All @@ -40,18 +37,5 @@ flag_management:
target: auto
threshold: 10 # Let's decrease this later.
- type: patch
target: auto # Allows PRs without tests, overall stats count.
threshold: 100
individual_flags:
- name: tm2
paths:
- tm2
- name: gnovm
paths:
- gnovm
- name: gno.land
paths:
- gno.land
- name: misc
paths:
- misc
target: auto # Let's decrease this later.
threshold: 10
3 changes: 1 addition & 2 deletions .github/workflows/examples.yml → .github/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ jobs:
run: |
export LOG_PATH_DIR=${{ runner.temp }}/logs
mkdir -p $LOG_PATH_DIR

echo "LOG_LEVEL=debug" >> $GITHUB_ENV
echo "LOG_PATH_DIR=$LOG_PATH_DIR" >> $GITHUB_ENV
- run: go install -v ./gnovm/cmd/gno
Expand Down Expand Up @@ -95,4 +94,4 @@ jobs:
# 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)
git diff --exit-code || (echo "Some gno.mod files are not tidy, please run 'make tidy'." && exit 1)
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
name: docker
on:
pull_request:
paths:
- "**"
- "!misc/**"
- "!docs/**"
- "!**.md"
push:
branches: [ "master" ]

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/autocounterd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/benchmark-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@ name: run benchmarks on every PR
on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
check:
uses: ./.github/workflows/benchmark.yml
uses: ./.github/workflows/benchmark_template.yml
secrets: inherit
with:
publish: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/benchmark-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- cron: '0 0 * * *' # run on default branch every day
jobs:
publish:
uses: ./.github/workflows/benchmark.yml
uses: ./.github/workflows/benchmark_template.yml
secrets: inherit
with:
publish: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
test-flags:
required: true
type: string

env:
CGO_ENABLED: 0

jobs:
benchmarks:
if: ${{ github.repository == 'gnolang/gno' }}
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/build_template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
on:
workflow_call:
inputs:
modulepath:
required: true
type: string
go-version:
required: true
type: string

jobs:
generated:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go-version }}

- name: Checkout code
uses: actions/checkout@v4

- name: Check generated files are up to date
working-directory: ${{ inputs.modulepath }}
run: |
go generate -x ./...
if [ "$(git status -s)" != "" ]; then
echo "command 'go generate' creates file that differ from git tree, please run 'go generate' and commit:"
git status -s
exit 1
fi
36 changes: 0 additions & 36 deletions .github/workflows/codegen.yml

This file was deleted.

84 changes: 21 additions & 63 deletions .github/workflows/contribs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,74 +2,32 @@ name: contribs

on:
push:
branches: [ "master" ]
pull_request:
branches:
- master
workflow_dispatch:
pull_request:
paths:
- "contribs/**"
- ".github/workflows/contribs.yml"
- "gnovm/**.go"
- "gno.land/**.go"
- "tm2/**.go"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
- ".github/**"

jobs:
install:
strategy:
fail-fast: false
matrix:
goversion:
- "1.22.x"
program:
- "gnomd"
- "gnodev"
- "gnofaucet"
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.goversion }}
- run: make install.${{ matrix.program }}
working-directory: contribs

test:
strategy:
fail-fast: false
matrix:
goversion: # two latest versions
- "1.21.x"
- "1.22.x"
program:
- "gnodev"
setup:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
programs: ${{ steps.set-matrix.outputs.programs }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.goversion }}
- run: make test.${{ matrix.program }}
working-directory: contribs

lint:
- id: set-matrix
run: echo "::set-output name=programs::$(ls -d contribs/*/ | cut -d/ -f2 | jq -R -s -c 'split("\n")[:-1]')"
main:
needs: setup
strategy:
fail-fast: false
matrix:
goversion:
- "1.22.x"
program:
- "gnodev"
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.goversion }}
- run: make lint.${{ matrix.program }}
working-directory: contribs

fail-fast: false
matrix:
program: ${{ fromJson(needs.setup.outputs.programs) }}
name: Run Main
uses: ./.github/workflows/main_template.yml
with:
modulepath: contribs/${{ matrix.program }}
secrets:
codecov-token: ${{ secrets.CODECOV_TOKEN }}
54 changes: 0 additions & 54 deletions .github/workflows/db-tests.yml

This file was deleted.

Loading
Loading