Skip to content

Commit

Permalink
chore: check publishable crates separately (#12628)
Browse files Browse the repository at this point in the history
closes #12625 

cc @staffik
  • Loading branch information
eagr authored Dec 17, 2024
1 parent a794080 commit 7712f8b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -425,13 +425,25 @@ jobs:
fail_ci_if_error: true
flags: pytests,upgradability,linux

windows_public_libraries_check:
name: "Windows check for building public libraries"
runs-on: "windows-latest"
publishable_packages_check:
name: "Cargo check publishable packages separately"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Linux
id: linux
os: ubuntu-latest
- name: Windows
id: win
os: windows-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@5ce83af8b5520828f63d83d98df0eea6a66c7978
with:
tool: just
- run: just check_build_public_libraries
- run: just check-publishable-separately
- run: just check-publishable-separately --no-default-features
- run: just check-publishable-separately --all-features
10 changes: 7 additions & 3 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ platform_excludes := if os() == "macos" {
}

nightly_flags := "--features nightly,test_features"
public_libraries := "-p near-primitives -p near-crypto -p near-jsonrpc-primitives -p near-chain-configs -p near-primitives-core"

export RUST_BACKTRACE := env("RUST_BACKTRACE", "short")
ci_hack_nextest_profile := if env("CI_HACKS", "0") == "1" { "--profile ci" } else { "" }
Expand Down Expand Up @@ -150,5 +149,10 @@ check-protocol-schema:
env {{protocol_schema_env}} cargo test -p protocol-schema-check --profile dev-artifacts
env {{protocol_schema_env}} cargo run -p protocol-schema-check --profile dev-artifacts

check_build_public_libraries:
cargo check {{public_libraries}}
publishable := "cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.publish == null or (.publish | length > 0)) | .name'"
check-publishable-separately *OPTIONS:
#!/usr/bin/env bash
for pkg in $({{ publishable }}); do
echo "Checking $pkg..."
cargo check -p $pkg {{ OPTIONS }}
done

0 comments on commit 7712f8b

Please sign in to comment.