diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..c0f327dc --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,66 @@ +name: Lint + +on: + push: + branches: + - develop + pull_request: + workflow_dispatch: + +jobs: + clippy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Get nightly version to use + id: nightly + run: echo "version=$(cat .github/nightly-version)" >> $GITHUB_OUTPUT + + - name: Build Dependencies + uses: ./.github/actions/build-dependencies + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + rust-toolchain: ${{ steps.nightly.outputs.version }} + rust-components: clippy + + - name: Run Clippy + run: cargo clippy --all-features --all-targets -- -D warnings -A clippy::items_after_test_module + + deny: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Advisory Cache + uses: actions/cache@v3 + with: + path: ~/.cargo/advisory-db + key: rust-advisory-db + + - name: Install cargo + uses: dtolnay/rust-toolchain@stable + + - name: Install cargo deny + run: cargo install --locked cargo-deny + + - name: Run cargo deny + run: cargo deny -L error --all-features check + + fmt: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Get nightly version to use + id: nightly + run: echo "version=$(cat .github/nightly-version)" >> $GITHUB_OUTPUT + + - name: Install rustfmt + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ steps.nightly.outputs.version }} + components: rustfmt + + - name: Run rustfmt + run: cargo +${{ steps.nightly.outputs.version }} fmt -- --check diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cdc1e11c..5fa12f39 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,46 +8,110 @@ on: workflow_dispatch: jobs: - clippy: + test-common: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Get nightly version to use - id: nightly - run: echo "version=$(cat .github/nightly-version)" >> $GITHUB_OUTPUT - - - name: Build Dependencies - uses: ./.github/actions/build-dependencies + - name: Test Dependencies + uses: ./.github/actions/test-dependencies with: github-token: ${{ secrets.GITHUB_TOKEN }} - rust-toolchain: ${{ steps.nightly.outputs.version }} - rust-components: clippy - - name: Run Clippy - run: cargo clippy --all-features --all-targets -- -D warnings -A clippy::items_after_test_module + - name: Run Tests + run: | + GITHUB_CI=true cargo test --all-features \ + -p std-shims \ + -p zalloc \ + -p serai-db - deny: + test-crypto: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Advisory Cache - uses: actions/cache@v3 + - name: Test Dependencies + uses: ./.github/actions/test-dependencies with: - path: ~/.cargo/advisory-db - key: rust-advisory-db + github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Install cargo - uses: dtolnay/rust-toolchain@stable + - name: Run Tests + run: | + GITHUB_CI=true cargo test --all-features \ + -p flexible-transcript \ + -p ff-group-tests \ + -p dalek-ff-group \ + -p ed448 \ + -p ciphersuite \ + -p multiexp \ + -p schnorr \ + -p dleq \ + -p dkg \ + -p frost \ + -p schnorrkel - - name: Install cargo deny - run: cargo install --locked cargo-deny + test-coins: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 - - name: Run cargo deny - run: cargo deny -L error --all-features check + - name: Test Dependencies + uses: ./.github/actions/test-dependencies + with: + github-token: ${{ secrets.GITHUB_TOKEN }} - test: + - name: Run Tests + run: | + GITHUB_CI=true cargo test --all-features \ + -p bitcoin-serai \ + -p ethereum-serai \ + -p monero-generators \ + -p monero-serai + + test-infra: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Test Dependencies + uses: ./.github/actions/test-dependencies + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Run Tests + run: | + GITHUB_CI=true cargo test --all-features \ + -p serai-message-queue \ + -p serai-processor-messages \ + -p serai-processor \ + -p tendermint-machine \ + -p tributary-chain \ + -p serai-coordinator + + test-substrate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Test Dependencies + uses: ./.github/actions/test-dependencies + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Run Tests + run: | + GITHUB_CI=true cargo test --all-features \ + -p serai-primitives \ + -p serai-tokens-primitives \ + -p serai-tokens-pallet \ + -p serai-in-instructions-primitives \ + -p serai-in-instructions-pallet \ + -p serai-validator-sets-primitives \ + -p serai-validator-sets-pallet \ + -p serai-runtime \ + -p serai-node + + test-serai-client: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -63,22 +127,4 @@ jobs: cargo build - name: Run Tests - run: GITHUB_CI=true cargo test --all-features - - fmt: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Get nightly version to use - id: nightly - run: echo "version=$(cat .github/nightly-version)" >> $GITHUB_OUTPUT - - - name: Install rustfmt - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ steps.nightly.outputs.version }} - components: rustfmt - - - name: Run rustfmt - run: cargo +${{ steps.nightly.outputs.version }} fmt -- --check + run: GITHUB_CI=true cargo test --all-features -p serai-client diff --git a/Cargo.toml b/Cargo.toml index 409543d2..c2b1f884 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,6 +19,7 @@ members = [ "crypto/frost", "crypto/schnorrkel", + "coins/bitcoin", "coins/ethereum", "coins/monero/generators", "coins/monero", diff --git a/tests/no-std/Cargo.toml b/tests/no-std/Cargo.toml index 6b29278a..f8b60d39 100644 --- a/tests/no-std/Cargo.toml +++ b/tests/no-std/Cargo.toml @@ -1,9 +1,9 @@ [package] -name = "serai-no-std" +name = "serai-no-std-tests" version = "0.1.0" description = "A crate to test no-std builds of Serai crates work" license = "MIT" -repository = "https://github.com/kayabaNerve/serai/tree/develop/common/std-shims" +repository = "https://github.com/kayabaNerve/serai/tree/develop/tests/no-std" authors = ["Luke Parker "] keywords = ["nostd", "no_std", "alloc", "io"] edition = "2021"