-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: ryanmorphl2 <163962984+ryanmorphl2@users.noreply.github.com> Co-authored-by: vincent <vincent.ch.cn@gmail.com>
- Loading branch information
1 parent
2add9e0
commit f7b7db6
Showing
59 changed files
with
11,169 additions
and
5,427 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Gas-oracle | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "gas-oracle/**" | ||
- ".github/workflows/gas-oracle.yaml" | ||
pull_request: | ||
paths: | ||
- "gas-oracle/**" | ||
- ".github/workflows/gas-oracle.yaml" | ||
|
||
defaults: | ||
run: | ||
working-directory: "gas-oracle" | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Run build | ||
run: make build | ||
- name: Run tests | ||
run: make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"rust-analyzer.linkedProjects": ["gas-oracle/app/Cargo.toml", "prover/Cargo.toml"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,40 @@ | ||
# Run cargo build with release tag | ||
build: | ||
cd app&&cargo build --release | ||
cd app && cargo build --release | ||
|
||
# Generate bin file and run | ||
run:build | ||
./app/target/release/app | ||
./app/target/release/app | ||
|
||
# Run the formatter but don't change any files. | ||
fmt: | ||
cd app && cargo +nightly fmt --all -- --check | ||
|
||
# Run the formatter and update files with style changes | ||
lint: | ||
cd app && cargo +nightly fmt --all | ||
|
||
# Run clippy | ||
clippy: | ||
cd app && cargo +nightly clippy --all-targets -- -D warnings | ||
|
||
# Run all tests | ||
test: | ||
cd app && cargo test | ||
.PHONY: test | ||
|
||
# Clean the builds | ||
clean: | ||
cd app && cargo clean | ||
|
||
# Generate the help message | ||
help: | ||
@echo "usage: make [target]" | ||
@echo "" | ||
@echo "fmt: Run the formatter but don't change any files." | ||
@echo "lint: Run the formatter and update files with style changes" | ||
@echo "clippy: Run clippy" | ||
@echo "test: Run all tests" | ||
@echo "clean: Clean the builds" | ||
@echo "help: Show this help message" | ||
@echo "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,31 @@ | ||
# gas oracle | ||
|
||
### build | ||
## Development | ||
|
||
### Prerequisites | ||
|
||
Make sure you have Rust installed. We recommend using [rustup](https://rustup.rs/). On top of the stable version of Rust, you will also need to install the nightly version of Rust, since the nightly version is used for some of the build and test scripts. | ||
|
||
```bash | ||
rustup toolchain install nightly | ||
``` | ||
|
||
### Makefile | ||
|
||
The Makefile contains various commands for building, testing, and linting the files. A list of the commands can be found by running `make help`. | ||
|
||
### Testing | ||
|
||
To run all tests, run `make test`. | ||
|
||
### Linting | ||
|
||
To run a format check but not actually format the code, run `make fmt`. To run a format check and format the code, run `make lint`. To run a clippy check, run `make clippy`. | ||
|
||
### Build | ||
|
||
`make build` | ||
### run | ||
|
||
### Run | ||
|
||
`make run` |
Oops, something went wrong.