Skip to content

Commit

Permalink
Make use of linting and setup for most services (#954)
Browse files Browse the repository at this point in the history
  • Loading branch information
rimrakhimov authored Jun 27, 2024
1 parent eafa3da commit 5e0f778
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 305 deletions.
File renamed without changes.
4 changes: 1 addition & 3 deletions .github/workflows/da-indexer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ on:
- da-indexer/**
- .github/workflows/da-indexer.yml
- .github/workflows/_*.yml
- .github/workflows/r_*.yml
- .github/actions/**
pull_request:
paths:
- da-indexer/**
- .github/workflows/da-indexer.yml
- .github/workflows/_*.yml
- .github/workflows/r_*.yml
- .github/actions/**

name: Test, lint and docker (da-indexer)
Expand Down Expand Up @@ -69,7 +67,7 @@ jobs:

lint:
name: Linting
uses: ./.github/workflows/r_linting.yml
uses: ./.github/workflows/_linting.yml
with:
working-directory: da-indexer

Expand Down
54 changes: 10 additions & 44 deletions .github/workflows/eth-bytecode-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ on:
paths:
- eth-bytecode-db/**
- .github/workflows/eth-bytecode-db.yml
- .github/actions/deps/**
- .github/workflows/_*.yml
- .github/actions/**
pull_request:
paths:
- eth-bytecode-db/**
- .github/workflows/eth-bytecode-db.yml
- .github/actions/deps/**
- .github/workflows/_*.yml
- .github/actions/**

name: Test, lint and docker (eth-bytecode-db)

Expand Down Expand Up @@ -45,6 +45,11 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup
with:
working-directory: eth-bytecode-db

- name: Set postgres max_connections
run: |
psql -h localhost -p 5432 -c "ALTER SYSTEM SET max_connections = 500;" -d postgres
Expand All @@ -58,22 +63,6 @@ jobs:
with:
args: docker restart postgres

- name: Install deps
uses: ./.github/actions/deps

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
workspaces: eth-bytecode-db -> target

- name: Unit tests
run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture
if: success() || failure()
Expand All @@ -90,32 +79,9 @@ jobs:

lint:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install deps
uses: ./.github/actions/deps

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
components: rustfmt, clippy
override: true

- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
workspaces: eth-bytecode-db -> target

- name: cargo fmt
run: cargo fmt --all -- --check --config imports_granularity=Crate

- name: cargo clippy
run: cargo clippy --all --all-targets --all-features -- -D warnings
uses: ./.github/workflows/_linting.yml
with:
working-directory: eth-bytecode-db

docker:
name: Docker build and docker push
Expand Down
50 changes: 8 additions & 42 deletions .github/workflows/proxy-verifier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ on:
paths:
- proxy-verifier/**
- .github/workflows/proxy-verifier.yml
- .github/actions/deps/**
- .github/workflows/_*.yml
- .github/actions/**
pull_request:
paths:
- proxy-verifier/**
- .github/workflows/proxy-verifier.yml
- .github/actions/deps/**
- .github/workflows/_*.yml
- .github/actions/**

name: Test, lint and docker (proxy-verifier)

Expand All @@ -30,21 +30,10 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install deps
uses: ./.github/actions/deps

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

- name: Rust cache
uses: Swatinem/rust-cache@v2
- name: Setup
uses: ./.github/actions/setup
with:
cache-on-failure: true
workspaces: proxy-verifier -> target
working-directory: proxy-verifier

- name: Unit tests
run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture
Expand All @@ -60,32 +49,9 @@ jobs:

lint:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install deps
uses: ./.github/actions/deps

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
components: rustfmt, clippy
override: true

- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
workspaces: proxy-verifier -> target

- name: cargo fmt
run: cargo fmt --all -- --check --config imports_granularity=Crate

- name: cargo clippy
run: cargo clippy --all --all-targets --all-features -- -D warnings
uses: ./.github/workflows/_linting.yml
with:
working-directory: proxy-verifier

docker:
name: Docker build and docker push
Expand Down
50 changes: 8 additions & 42 deletions .github/workflows/sig-provider.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ on:
paths:
- sig-provider/**
- .github/workflows/sig-provider.yml
- .github/actions/deps/**
- .github/workflows/_*.yml
- .github/actions/**
pull_request:
paths:
- sig-provider/**
- .github/workflows/sig-provider.yml
- .github/actions/deps/**
- .github/workflows/_*.yml
- .github/actions/**

name: Test, lint and docker (sig-provider)

Expand All @@ -30,21 +30,10 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install deps
uses: ./.github/actions/deps

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

- name: Rust cache
uses: Swatinem/rust-cache@v2
- name: Setup
uses: ./.github/actions/setup
with:
cache-on-failure: true
workspaces: sig-provider -> target
working-directory: sig-provider

- name: Unit tests
run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture
Expand All @@ -60,32 +49,9 @@ jobs:

lint:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install deps
uses: ./.github/actions/deps

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
components: rustfmt, clippy
override: true

- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
workspaces: sig-provider -> target

- name: cargo fmt
run: cargo fmt --all -- --check --config imports_granularity=Crate

- name: cargo clippy
run: cargo clippy --all --all-targets --all-features -- -D warnings
uses: ./.github/workflows/_linting.yml
with:
working-directory: sig-provider

docker:
name: Docker build and docker push
Expand Down
50 changes: 8 additions & 42 deletions .github/workflows/smart-contract-verifier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ on:
paths:
- smart-contract-verifier/**
- .github/workflows/smart-contract-verifier.yml
- .github/actions/deps/**
- .github/workflows/_*.yml
- .github/actions/**
pull_request:
paths:
- smart-contract-verifier/**
- .github/workflows/smart-contract-verifier.yml
- .github/actions/deps/**
- .github/workflows/_*.yml
- .github/actions/**

name: Test, lint and docker (smart-contract-verifier)

Expand All @@ -30,21 +30,10 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install deps
uses: ./.github/actions/deps

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

- name: Rust cache
uses: Swatinem/rust-cache@v2
- name: Setup
uses: ./.github/actions/setup
with:
cache-on-failure: true
workspaces: smart-contract-verifier -> target
working-directory: smart-contract-verifier

- name: Unit tests
run: RUST_BACKTRACE=1 RUST_LOG=info cargo test --locked --workspace --all-features --lib --bins -- --nocapture
Expand All @@ -60,32 +49,9 @@ jobs:

lint:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install deps
uses: ./.github/actions/deps

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
components: rustfmt, clippy
override: true

- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
workspaces: smart-contract-verifier -> target

- name: cargo fmt
run: cargo fmt --all -- --check --config imports_granularity=Crate

- name: cargo clippy
run: cargo clippy --all --all-targets --all-features -- -D warnings
uses: ./.github/workflows/_linting.yml
with:
working-directory: smart-contract-verifier

docker:
name: Docker build and docker push
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/smart-guessr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ on:
paths:
- smart-guessr/**
- .github/workflows/smart-guessr.yml
- .github/workflows/_*.yml
- .github/workflows/_docker-build-push.yml
pull_request:
paths:
- smart-guessr/**
- .github/workflows/smart-guessr.yml
- .github/workflows/_*.yml
- .github/workflows/_docker-build-push.yml

name: Test and docker (smart-guessr)

Expand Down
Loading

0 comments on commit 5e0f778

Please sign in to comment.