-
Notifications
You must be signed in to change notification settings - Fork 12
Just-ify CI #322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Just-ify CI #322
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Opt in to the v3 MSRV-aware resolver. | ||
| [resolver] | ||
| incompatible-rust-versions = "fallback" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,69 +1,70 @@ | ||
| name: Build & Test | ||
| # A few guiding principles. | ||
| # | ||
| # * Always use actions-rust-lang/setup-rust-toolchain for its built-in caching. | ||
| # * Complexity lives in the justfile, this runner is as light as possible. | ||
|
|
||
| name: CI | ||
|
|
||
| # Run on direct commits to master, including merges, and any pull requests against master. | ||
rustaceanrob marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| pull_request: | ||
| branches: | ||
| - master | ||
|
|
||
| jobs: | ||
| build: | ||
| # Quick canary of code as well as potential issues with upcoming toolchains. | ||
| check: | ||
| strategy: | ||
| matrix: | ||
| platform: [ubuntu-latest, macos-latest, windows-latest] | ||
| toolchain: [stable, beta, nightly] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: extractions/setup-just@v3 | ||
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
| with: | ||
| toolchain: ${{ matrix.toolchain }} | ||
| components: clippy,rustfmt | ||
| - run: just check | ||
rustaceanrob marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # Build and test the code across platforms. | ||
| test: | ||
| strategy: | ||
| matrix: | ||
| platform: [ubuntu-latest, macos-latest, windows-latest] | ||
| runs-on: ${{ matrix.platform }} | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Update Toolchain | ||
| run: | | ||
| rustup default ${{ matrix.toolchain }} | ||
| rustup component add --toolchain ${{ matrix.toolchain }} rustfmt | ||
| rustup component add --toolchain ${{ matrix.toolchain }} clippy | ||
| rustup update ${{ matrix.toolchain }} | ||
| - name: Lint all targets | ||
| run: cargo clippy --all-targets | ||
| - name: Format | ||
| run: cargo fmt -- --check | ||
| - name: Build with defeault features | ||
| run: cargo build --verbose | ||
| - name: Check release build on Rust ${{ matrix.toolchain }} | ||
| run: cargo check --release --verbose --color always | ||
| - name: Unit test | ||
| run: cargo test --verbose --lib | ||
| - name: Doc test | ||
| run: cargo test --verbose --doc | ||
| # Check that library code can be compiled with MSRV (1.63.0). | ||
| - uses: actions/checkout@v4 | ||
| - uses: extractions/setup-just@v3 | ||
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
| - run: just test unit | ||
| features: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: extractions/setup-just@v3 | ||
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
| - run: just test features | ||
| msrv: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| # Modify build tools just for MSRV testing. This avoids us having | ||
| # to bump our MSRV just for tooling. Tooling doesn't effect consumers so not a risk. | ||
| - name: Prepare environment for MSRV toolchain | ||
| run: | | ||
| # Remove resolver = "3" line for MSRV compatibility. We use V3 to | ||
| # generate an MSRV-compliant lockfile, but this isn't necessary to | ||
| # check if library code is MSRV compliant. Any resolver can go | ||
| # and grab the versions specified in the committed lockfile. | ||
| # | ||
| # The V3 resolver is standard in rust 1.85. | ||
| sed -i '/resolver = "3"/d' Cargo.toml | ||
| - name: Install MSRV toolchain | ||
| run: | | ||
| rustup toolchain install 1.63.0 | ||
| rustup default 1.63.0 | ||
| - name: Build with MSRV compiler | ||
| run: cargo build --verbose | ||
| signet: | ||
| - uses: actions/checkout@v4 | ||
| - uses: extractions/setup-just@v3 | ||
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
| - run: just test msrv | ||
| sync: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Sync signet | ||
| run: cargo test --verbose signet_syncs | ||
| bitcoind: | ||
| - uses: actions/checkout@v4 | ||
| - uses: extractions/setup-just@v3 | ||
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
| - run: just test sync | ||
| integration: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Integration test | ||
| run: cargo test -- --test-threads 1 --skip signet_syncs --nocapture | ||
| - uses: actions/checkout@v4 | ||
| - uses: extractions/setup-just@v3 | ||
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
| - run: just test integration | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| Cargo.lock | ||
| /target | ||
| /data | ||
| /light_client_data | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.