Skip to content

Commit

Permalink
bump opinit and cleanup github actions (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-1 authored Jul 30, 2024
1 parent 114c7be commit c5f12c9
Show file tree
Hide file tree
Showing 15 changed files with 214 additions and 179 deletions.
44 changes: 15 additions & 29 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,24 @@
---
name: Bug report
about: Create a report to help us improve (use this for suspected bugs only, if not sure, open a regular issue below)
title: ''
labels: Bug
assignees: ''
about: Create a report to help us improve
title: ""
labels: ""
assignees: ""
---

<!-- This issue tracker is only for technical issues related to Initia.
**Describe the bug**
A clear and concise description of what the bug is.

General initia questions and/or support requests are best directed to the initia support team.
**To Reproduce**
Steps to reproduce the behavior:

-->

<!-- Describe the issue -->
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

<!--- What behavior did you expect? Describe what the software should do in response to a specific action or command.-->

**Actual behavior**

<!--- What did the software actually do when you performed the action or command? If you're unsure whether the issue is related to Initia, feel free to ask us for clarification."
-->

**To reproduce**

<!--- How reliably can you reproduce the issue, what are the steps to do so? -->

**System information**

<!-- What version of initia are you using, where did you get it (website, self-compiled, etc)? -->

<!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

<!-- initia-related issue? What is your operating system and its version? If Linux, what is your desktop environment and graphical shell? -->

<!-- Any extra information that might be useful in the debugging process. -->
**Additional context**
Add any other context about the problem here.
15 changes: 7 additions & 8 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: Feature
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
<!-- A clear and concise description of what you want to happen. -->
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
<!-- Add any other context or screenshots about the feature request here. -->
Add any other context or screenshots about the feature request here.
78 changes: 46 additions & 32 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,46 @@
<!--
*** Please remove the following help text before submitting: ***
Pull requests without a rationale and clear improvement may be closed
immediately.
-->

<!--
Please provide clear motivation for your patch and explain how it improves
initia user experience or initia developer experience
significantly:
* Any test improvements or new tests that improve coverage are always welcome.
* All other changes should have accompanying unit tests (see `src/test/`) or
functional tests (see `test/`). Contributors should note which tests cover
modified code. If no tests exist for a region of modified code, new tests
should accompany the change.
* Bug fixes are most welcome when they come with steps to reproduce or an
explanation of the potential issue as well as reasoning for the way the bug
was fixed.
* Features are welcome, but might be rejected due to design or scope issues.
If a feature is based on a lot of dependencies, contributors should first
consider building the system outside of initia, if possible.
-->

<!--
Initia has a thorough review process and even the most trivial change
needs to pass a lot of eyes and requires non-zero or even substantial time
effort to review. There is a huge lack of active reviewers on the project, so
patches often sit for a long time.
-->
# Description

Closes: #XXXX

<!-- Add a description of the changes that this PR introduces and the files that
are the most critical to review. -->

---

## Author Checklist

_All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues._

I have...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title, you can find examples of the prefixes below:
<!-- * `feat`: A new feature
* `fix`: A bug fix
* `docs`: Documentation only changes
* `style`: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
* `refactor`: A code change that neither fixes a bug nor adds a feature
* `perf`: A code change that improves performance
* `test`: Adding missing tests or correcting existing tests
* `build`: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
* `ci`: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
* `chore`: Other changes that don't modify src or test files
* `revert`: Reverts a previous commit -->
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] targeted the correct branch
- [ ] provided a link to the relevant issue or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] included the necessary unit and integration tests
- [ ] updated the relevant documentation or specification, including comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] confirmed all CI checks have passed

## Reviewers Checklist

_All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items._

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed all author checklist items have been addressed
- [ ] reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage
7 changes: 5 additions & 2 deletions .github/workflows/build-darwin-amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.4'
go-version: "1.22.4"

- name: Set environment variables
run: |
Expand Down Expand Up @@ -51,10 +51,13 @@ jobs:
&& cd ./build \
&& tar -czvf minievm_"$VERSION"_Darwin_"$ARCH_NAME".tar.gz ./minitiad \
&& mv ./minievm_"$VERSION"_Darwin_"$ARCH_NAME".tar.gz $GITHUB_WORKSPACE/ \
&& rm -rf ./minitiad
&& rm -rf ./minitiad
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
minievm_${{ env.VERSION }}_Darwin_${{ env.ARCH_NAME }}.tar.gz
env:
VERSION: ${{ env.VERSION }}
ARCH_NAME: ${{ env.ARCH_NAME }}
14 changes: 8 additions & 6 deletions .github/workflows/build-darwin-arm64.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: Build Darwin ARM64

on:
Expand All @@ -15,7 +14,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.4'
go-version: "1.22.4"
- name: Set environment variables
run: |
MINIWASM_NETWORK_NAME="minievm-1"
Expand All @@ -29,11 +28,11 @@ jobs:
fi
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "ARCH_NAME=aarch64" >> $GITHUB_ENV
- name: Ensure dependencies
run: |
go mod tidy
- name: Print environment variables
run: |
echo "GOARCH=${GOARCH}"
Expand All @@ -49,10 +48,13 @@ jobs:
&& cd ./build \
&& tar -czvf minievm_"$VERSION"_Darwin_"$ARCH_NAME".tar.gz ./minitiad \
&& mv ./minievm_"$VERSION"_Darwin_"$ARCH_NAME".tar.gz $GITHUB_WORKSPACE/ \
&& rm -rf ./minitiad
&& rm -rf ./minitiad
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
minievm_${{ env.VERSION }}_Darwin_${{ env.ARCH_NAME }}.tar.gz
env:
VERSION: ${{ env.VERSION }}
ARCH_NAME: ${{ env.ARCH_NAME }}
9 changes: 5 additions & 4 deletions .github/workflows/build-linux-amd64.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

name: Build Linux AMD64

on:
workflow_call
on: workflow_call

jobs:
build:
Expand All @@ -14,7 +12,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.4'
go-version: "1.22.4"

- name: Set environment variables
run: |
Expand Down Expand Up @@ -49,3 +47,6 @@ jobs:
with:
files: |
./build/minievm_${{ env.VERSION }}_Linux_${{ env.ARCH_NAME }}.tar.gz
env:
VERSION: ${{ env.VERSION }}
ARCH_NAME: ${{ env.ARCH_NAME }}
10 changes: 6 additions & 4 deletions .github/workflows/build-linux-arm64.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: Build Linux ARM64

on:
Expand Down Expand Up @@ -32,7 +31,7 @@ jobs:
fi
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "ARCH_NAME=aarch64" >> $GITHUB_ENV
- name: Build for ARM64
env:
DOCKER_BUILDKIT: 1
Expand Down Expand Up @@ -67,9 +66,12 @@ jobs:
- name: List files
run: ls -l

- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
./minievm_${{ env.VERSION }}_Linux_${{ env.ARCH_NAME }}.tar.gz
./minievm_${{ env.VERSION }}_Linux_${{ env.ARCH_NAME }}.tar.gz
env:
VERSION: ${{ env.VERSION }}
ARCH_NAME: ${{ env.ARCH_NAME }}
5 changes: 2 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ jobs:
- name: Build and push
uses: docker/build-push-action@v4
with:
build-args: "GITHUB_ACCESS_TOKEN=${{ secrets.GH_READ_TOKEN }}"
file: images/private/Dockerfile
file: Dockerfile
push: ${{ startsWith(github.ref, 'refs/tags') }} # push image only for tags
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta.outputs.labels }}
13 changes: 2 additions & 11 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ concurrency:
jobs:
golangci:
env:
# for private repo access
GOPRIVATE: github.com/initia-labs
GITHUB_ACCESS_TOKEN: ${{ secrets.GH_READ_TOKEN }}
GOLANGCI_LINT_VERSION: v1.59.1
name: golangci-lint
runs-on: ubuntu-latest
Expand All @@ -42,15 +39,15 @@ jobs:
**/**.go
go.mod
go.sum
# for private repo access
- run: git config --global url.https://${GITHUB_ACCESS_TOKEN}:[email protected]/.insteadOf https://github.com/
# install golangci-lint
- run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}
- name: run go linters (long)
if: env.GIT_DIFF
id: lint_long
run: |
make lint
env:
GIT_DIFF: ${{ env.GIT_DIFF }}
- uses: technote-space/[email protected]
if: steps.lint_long.outcome == 'skipped'
with:
Expand All @@ -68,10 +65,6 @@ jobs:
# Use --check or --exit-code when available (Go 1.19?)
# https://github.com/golang/go/issues/27005
tidy:
env:
# for private repo access
GOPRIVATE: github.com/initia-labs,github.com/skip-mev/slinky
GITHUB_ACCESS_TOKEN: ${{ secrets.GH_READ_TOKEN }}
runs-on: ubuntu-latest
name: tidy
steps:
Expand All @@ -81,8 +74,6 @@ jobs:
with:
go-version: 1.22
check-latest: true
# for private repo access
- run: git config --global url.https://${GITHUB_ACCESS_TOKEN}:[email protected]/.insteadOf https://github.com/
- run: |
go mod tidy
CHANGES_IN_REPO=$(git status --porcelain)
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ jobs:
test-coverage-upload:
name: Run test and upload codecov
env:
# for private repo access
GOPRIVATE: github.com/initia-labs/*
GITHUB_ACCESS_TOKEN: ${{ secrets.GH_READ_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
runs-on: ubuntu-latest
steps:
Expand All @@ -40,15 +37,15 @@ jobs:
**/**.go
go.mod
go.sum
# for private repo access
- run: git config --global url.https://${GITHUB_ACCESS_TOKEN}:[email protected]/.insteadOf https://github.com/
- name: build
run: |
make build
- name: test & coverage report creation
run: |
go test ./... -mod=readonly -timeout 12m -race -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock'
if: env.GIT_DIFF
env:
GIT_DIFF: ${{ env.GIT_DIFF }}
# - name: filter out DONTCOVER
# run: |
# excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')"
Expand All @@ -65,3 +62,5 @@ jobs:
files: ./coverage.txt
fail_ci_if_error: true
if: env.GIT_DIFF
env:
GIT_DIFF: ${{ env.GIT_DIFF }}
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ require (
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/hashicorp/go-metrics v0.5.3
github.com/holiman/uint256 v1.2.4
github.com/initia-labs/OPinit v0.3.2
github.com/initia-labs/initia v0.3.5
github.com/initia-labs/OPinit v0.4.0
github.com/initia-labs/initia v0.4.0
github.com/initia-labs/kvindexer v0.1.5
github.com/initia-labs/kvindexer/submodules/block v0.1.0
github.com/initia-labs/kvindexer/submodules/pair v0.1.1
Expand Down Expand Up @@ -174,7 +174,7 @@ require (
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/improbable-eng/grpc-web v0.15.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/initia-labs/OPinit/api v0.3.0 // indirect
github.com/initia-labs/OPinit/api v0.4.0 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
Expand Down
Loading

0 comments on commit c5f12c9

Please sign in to comment.