feat: introduce BytesInDisplayOrder trait to standardize byte-reversed encoding in RPC (#9806)
#28
Workflow file for this run
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
| name: Unit Tests | |
| on: | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - "**/*.rs" | |
| - "**/Cargo.toml" | |
| - "**/Cargo.lock" | |
| - .config/nextest.toml | |
| - .github/workflows/tests-unit.yml | |
| push: | |
| branches: [main] | |
| paths: | |
| - "**/*.rs" | |
| - "**/Cargo.toml" | |
| - "**/Cargo.lock" | |
| - .config/nextest.toml | |
| - .github/workflows/tests-unit.yml | |
| # Ensures that only one workflow task will run at a time. Previous builds, if | |
| # already in process, will get cancelled. Only the latest commit will be allowed | |
| # to run, cancelling any workflows in between | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| RUST_LIB_BACKTRACE: 1 | |
| RUST_LOG: info | |
| COLORBT_SHOW_HIDDEN: 1 | |
| jobs: | |
| unit-tests: | |
| name: ${{ matrix.rust-version }} on ${{ matrix.os }} | |
| permissions: | |
| id-token: write | |
| statuses: write | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 120 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| rust-version: [stable, beta] | |
| features: [default-release-binaries] | |
| exclude: | |
| # Exclude macOS beta due to limited runner capacity and slower performance | |
| # Exclude Windows beta to reduce the amount of minutes cost per workflow run | |
| - os: macos-latest | |
| rust-version: beta | |
| - os: windows-latest | |
| rust-version: beta | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: actions-rust-lang/setup-rust-toolchain@ab6845274e2ff01cd4462007e1a9d9df1ab49f42 #v1.14.0 | |
| with: | |
| toolchain: ${{ matrix.rust-version }} | |
| cache-key: unit-tests-${{ matrix.os }}-${{ matrix.rust-version }}-${{ matrix.features }} | |
| cache-on-failure: true | |
| - uses: taiki-e/install-action@3ee5d63d29478156148c0b53e9f3447829b47bc2 #v2.58.23 | |
| with: | |
| tool: cargo-nextest | |
| - uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b #v3.0.0 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| # Windows-specific setup | |
| - name: Install LLVM on Windows | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| choco install llvm -y | |
| echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| echo "LIBCLANG_PATH=C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| - name: Minimise proptest cases on macOS and Windows | |
| # We set cases to 1, because some tests already run 1 case by default. | |
| # We keep maximum shrink iterations at the default value, because it only happens on failure. | |
| # | |
| # Windows compilation and tests are slower than other platforms. | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| echo "PROPTEST_CASES=1" >> $GITHUB_ENV | |
| echo "PROPTEST_MAX_SHRINK_ITERS=1024" >> $GITHUB_ENV | |
| - name: Run unit tests | |
| run: cargo nextest run --profile all-tests --locked --release --features "${{ matrix.features }}" --run-ignored=all | |
| env: | |
| TEST_LARGE_CHECKPOINTS: 1 | |
| check-no-git-dependencies: | |
| name: Check no git dependencies | |
| permissions: | |
| id-token: write | |
| statuses: write | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| if: contains(github.event.pull_request.labels.*.name, 'A-release') | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: actions-rust-lang/setup-rust-toolchain@ab6845274e2ff01cd4462007e1a9d9df1ab49f42 #v1.14.0 | |
| with: | |
| toolchain: stable | |
| cache-on-failure: true | |
| - uses: taiki-e/install-action@3ee5d63d29478156148c0b53e9f3447829b47bc2 #v2.58.23 | |
| with: | |
| tool: cargo-nextest | |
| - uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b #v3.0.0 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Check no git dependencies | |
| run: cargo nextest run --profile check-no-git-dependencies | |
| test-success: | |
| name: test success | |
| runs-on: ubuntu-latest | |
| if: always() | |
| needs: | |
| - unit-tests | |
| - check-no-git-dependencies | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Decide whether the needed jobs succeeded or failed | |
| uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe #v1.2.2 | |
| with: | |
| jobs: ${{ toJSON(needs) }} | |
| allowed-skips: check-no-git-dependencies |