Skip to content

Commit 70aaa80

Browse files
committed
chore: create root workspace and add lints
1 parent c4203db commit 70aaa80

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+11724
-1224
lines changed

.github/workflows/ci-fortuna.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,13 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v2
1919
- uses: Swatinem/rust-cache@v2
20-
with:
21-
workspaces: "apps/fortuna -> target"
22-
- uses: actions-rs/toolchain@v1
23-
with:
24-
toolchain: 1.82.0
25-
override: true
26-
components: rustfmt, clippy
20+
- uses: actions-rust-lang/setup-rust-toolchain@v1
2721
- name: Format check
2822
run: cargo fmt --all -- --check
2923
if: success() || failure()
3024
- name: Clippy check
31-
run: cargo clippy --tests -- --deny warnings
25+
run: cargo clippy -p fortuna --all-targets -- --deny warnings
3226
if: success() || failure()
3327
- name: Run tests
34-
run: cargo test
28+
run: cargo test -p fortuna
3529
if: success() || failure()

.github/workflows/ci-hermes-server.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,10 @@ jobs:
1515
working-directory: apps/hermes/server
1616
steps:
1717
- uses: actions/checkout@v2
18+
- uses: actions-rust-lang/setup-rust-toolchain@v1
1819
- uses: Swatinem/rust-cache@v2
1920
with:
2021
workspaces: "apps/hermes/server -> target"
21-
- uses: actions-rs/toolchain@v1
22-
with:
23-
toolchain: 1.82.0
24-
components: rustfmt, clippy
25-
override: true
2622
- name: Install protoc
2723
uses: arduino/setup-protoc@v3
2824
with:

.github/workflows/ci-lazer-rust.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,7 @@ jobs:
2020
with:
2121
submodules: recursive
2222
- uses: actions-rust-lang/setup-rust-toolchain@v1
23-
with:
24-
toolchain: 1.82.0
25-
components: clippy,rustfmt
2623
- uses: Swatinem/rust-cache@v2
27-
with:
28-
workspaces: "lazer -> target"
2924
- name: Install Protoc
3025
uses: arduino/setup-protoc@v3
3126
with:
@@ -45,11 +40,8 @@ jobs:
4540
run: cargo fmt --all -- --check
4641
if: success() || failure()
4742
- name: Clippy check
48-
run: cargo clippy --all-targets -- --deny warnings
49-
if: success() || failure()
50-
- name: Build Solana programs
51-
run: cargo build-sbf
43+
run: cargo clippy -p pyth-lazer-protocol -p pyth-lazer-client -p pyth-lazer-publisher-sdk --all-targets -- --deny warnings
5244
if: success() || failure()
5345
- name: test
54-
run: cargo test
46+
run: cargo test -p pyth-lazer-protocol -p pyth-lazer-client -p pyth-lazer-publisher-sdk
5547
if: success() || failure()

.github/workflows/ci-lazer-solana-contract.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v4
2020
- uses: actions-rust-lang/setup-rust-toolchain@v1
21+
- uses: Swatinem/rust-cache@v2
2122
with:
22-
toolchain: 1.82.0
23+
workspaces: "lazer/contracts/solana -> target"
2324
- name: install taplo
2425
run: cargo install --locked [email protected]
2526
- uses: actions/setup-node@v4
@@ -49,3 +50,13 @@ jobs:
4950
RUSTFLAGS= cargo +1.79.0 install --git https://github.com/coral-xyz/anchor --tag v0.30.1 --locked anchor-cli
5051
- name: Run anchor tests
5152
run: pnpm run test:anchor
53+
- name: check Cargo.toml formatting
54+
run: find . -name Cargo.toml -exec taplo fmt --check --diff {} \;
55+
- name: Format check
56+
run: cargo fmt --all -- --check
57+
- name: Clippy check
58+
run: cargo clippy --all-targets -- --deny warnings
59+
- name: Build contract
60+
run: cargo build-sbf
61+
- name: test
62+
run: cargo test

.github/workflows/ci-pyth-lazer-agent.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,13 @@ jobs:
2020
with:
2121
submodules: recursive
2222
- uses: actions-rust-lang/setup-rust-toolchain@v1
23-
with:
24-
toolchain: 1.87.0
25-
components: clippy,rustfmt
2623
- uses: Swatinem/rust-cache@v2
27-
with:
28-
workspaces: "apps/pyth-lazer-agent -> target"
2924
- name: Format check
3025
run: cargo fmt --all -- --check
3126
if: success() || failure()
3227
- name: Clippy check
33-
run: cargo clippy --all-targets -- --deny warnings
28+
run: cargo clippy -p pyth-lazer-agent --all-targets -- --deny warnings
3429
if: success() || failure()
3530
- name: test
36-
run: cargo test
31+
run: cargo test -p pyth-lazer-agent
3732
if: success() || failure()

.github/workflows/ci-pythnet-sdk.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,14 @@ jobs:
1515
working-directory: pythnet/pythnet_sdk
1616
steps:
1717
- uses: actions/checkout@v2
18+
- uses: actions-rust-lang/setup-rust-toolchain@v1
1819
- uses: Swatinem/rust-cache@v2
19-
with:
20-
workspaces: "pythnet/pythnet_sdk -> target"
21-
- uses: actions-rs/toolchain@v1
22-
with:
23-
toolchain: 1.82.0
24-
components: rustfmt, clippy
25-
override: true
2620
- name: Format check
2721
run: cargo fmt --all -- --check
2822
if: success() || failure()
2923
- name: Clippy check
30-
run: cargo clippy --tests -- --deny warnings
24+
run: cargo clippy -p pythnet-sdk --all-targets -- --deny warnings
3125
if: success() || failure()
3226
- name: Run executor tests
33-
run: cargo test
27+
run: cargo test -p pythnet-sdk
3428
if: success() || failure()

.github/workflows/ci-quorum.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,14 @@ jobs:
1515
working-directory: apps/quorum
1616
steps:
1717
- uses: actions/checkout@v2
18+
- uses: actions-rust-lang/setup-rust-toolchain@v1
1819
- uses: Swatinem/rust-cache@v2
19-
with:
20-
workspaces: "apps/quorum -> target"
21-
- uses: actions-rs/toolchain@v1
22-
with:
23-
toolchain: 1.87.0
24-
components: rustfmt, clippy
25-
override: true
2620
- name: Format check
2721
run: cargo fmt --all -- --check
2822
if: success() || failure()
2923
- name: Clippy check
30-
run: cargo clippy --tests -- --deny warnings
24+
run: cargo clippy -p quorum --all-targets -- --deny warnings
3125
if: success() || failure()
3226
- name: Run executor tests
33-
run: cargo test
27+
run: cargo test -p quorum
3428
if: success() || failure()

.github/workflows/ci-solana-contract.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ jobs:
2424
- uses: Swatinem/rust-cache@v2
2525
with:
2626
workspaces: "target_chains/solana -> target"
27-
- uses: actions-rs/toolchain@v1
28-
with:
29-
toolchain: 1.73.0
30-
components: rustfmt, clippy
31-
override: true
27+
- uses: actions-rust-lang/setup-rust-toolchain@v1
3228
- name: Install Solana
3329
run: |
3430
sh -c "$(curl -sSfL https://release.anza.xyz/v1.17.34/install)"

.github/workflows/ci-starknet-tools.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,33 @@ on:
99
jobs:
1010
test:
1111
runs-on: ubuntu-latest
12+
defaults:
13+
run:
14+
working-directory: target_chains/starknet/tools/test_vaas
1215
steps:
13-
- uses: actions/checkout@v2
14-
- uses: actions-rs/toolchain@v1
15-
with:
16-
toolchain: 1.86.0
17-
components: rustfmt, clippy
18-
override: true
1916
- uses: actions/checkout@v3
17+
- uses: actions-rust-lang/setup-rust-toolchain@v1
2018
- uses: Swatinem/rust-cache@v2
21-
with:
22-
workspaces: "target_chains/starknet/tools/test_vaas -> target"
2319
- name: Install Scarb
2420
uses: software-mansion/setup-scarb@v1
2521
with:
2622
tool-versions: target_chains/starknet/contracts/.tool-versions
2723
- name: Install Starkli
28-
run: curl https://get.starkli.sh | sh && . ~/.config/.starkli/env && starkliup -v $(awk '/starkli/{print $2}' target_chains/starknet/contracts/.tool-versions)
24+
run: |
25+
curl https://get.starkli.sh | sh
26+
. ~/.config/.starkli/env
27+
starkliup -v $(awk '/starkli/{print $2}' ../../contracts/.tool-versions)
28+
echo "${HOME}/.starkli/bin" >> "${GITHUB_PATH}"
2929
- name: Check formatting
30-
run: cargo fmt --manifest-path ./target_chains/starknet/tools/test_vaas/Cargo.toml -- --check
30+
run: cargo fmt -- --check
3131
- name: Run clippy
32-
run: cargo clippy --manifest-path ./target_chains/starknet/tools/test_vaas/Cargo.toml --all-targets -- --deny warnings
32+
run: cargo clippy -p test_vaas --all-targets -- --deny warnings
3333
- name: Run generate_keypair binary
34-
run: cargo run --manifest-path ./target_chains/starknet/tools/test_vaas/Cargo.toml --bin generate_keypair
34+
run: cargo run --bin generate_keypair
3535
- name: Check test data
3636
run: |
37-
. ~/.config/.starkli/env && cargo run --manifest-path ./target_chains/starknet/tools/test_vaas/Cargo.toml --bin generate_test_data > ./target_chains/starknet/contracts/data.cairo
38-
cd target_chains/starknet/contracts && scarb fmt data.cairo
37+
. ~/.config/.starkli/env && cargo run --bin generate_test_data > ../../contracts/data.cairo
38+
cd ../../contracts && scarb fmt data.cairo
3939
if ! diff ./tests/data.cairo data.cairo; then
4040
>&2 echo "Re-run generate_test_data to update data.cairo"
4141
exit 1

0 commit comments

Comments
 (0)