Skip to content

Commit

Permalink
Merge pull request #12 from 0xPolygonHermez/edu/add_rustfmt_clippy
Browse files Browse the repository at this point in the history
fix get_toolchain_download_url
  • Loading branch information
eduadiez authored Jul 19, 2024
2 parents 7db7586 + 1869c8b commit 68a2b62
Show file tree
Hide file tree
Showing 27 changed files with 303 additions and 200 deletions.
4 changes: 4 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ runs:
go-version: "1.22"
cache-dependency-path: "**/go.sum"

- name: Install protobuf-compiler
shell: bash
run: sudo apt-get install -y protobuf-compiler

- name: Print go version
shell: bash
run: go version
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ jobs:
deploy:
runs-on: ubuntu-latest
needs: [lint, build]
if: github.ref_name == 'develop' && github.event_name == 'push'

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: PR

on:
push:
branches: [develop]
pull_request:
branches:
- "**"
merge_group:

jobs:
test-x86_64:
name: Test on x86_64
runs-on: ubuntu-latest
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Setup CI
uses: ./.github/actions/setup

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
toolchain: nightly-2024-04-17
args: --all-targets --all-features

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
toolchain: nightly-2024-04-17
args: --release
env:
RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0 -C target-cpu=native
RUST_BACKTRACE: 1

lint:
name: Formatting & Clippy
runs-on: ubuntu-latest
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Setup CI
uses: ./.github/actions/setup

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
env:
CARGO_INCREMENTAL: 1

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-features --all-targets -- -D warnings -A incomplete-features
env:
CARGO_INCREMENTAL: 1
19 changes: 19 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"editor.inlineSuggest.enabled": true,
"[rust]": {
"editor.defaultFormatter": "rust-lang.rust-analyzer",
"editor.formatOnSave": true,
"editor.hover.enabled": true
},
"editor.rulers": [
100
],
"rust-analyzer.linkedProjects": [
"Cargo.toml",
],
//"rust-analyzer.showUnlinkedFileNotification": false,
// "rust-analyzer.showUnlinkedFileNotification": false,
// "rust-analyzer.check.workspace": false,
// "rust-analyzer.check.invocationStrategy": "once",
// "rust-analyzer.cargo.buildScripts.invocationStrategy": "once",
}
Loading

0 comments on commit 68a2b62

Please sign in to comment.