release: v3.7.0 #1144
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: Build & Test | |
| on: | |
| workflow_dispatch: | |
| workflow_call: | |
| inputs: | |
| plan: | |
| required: false | |
| type: string | |
| # pull_request: # No need to trigger on PR, cargo-dist already does | |
| push: | |
| branches: | |
| - master | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| nextest: | |
| runs-on: ${{matrix.os}} | |
| strategy: | |
| matrix: | |
| build: [linux, macos] | |
| include: | |
| - build: linux | |
| os: ubuntu-latest | |
| target: x86_64-unknown-linux-musl | |
| - build: macos | |
| os: macos-latest | |
| target: x86_64-apple-darwin | |
| steps: | |
| - name: "[linux] Install dependencies" | |
| run: | | |
| sudo apt-get install tmux | |
| tmux -V | |
| locale | |
| if: runner.os == 'Linux' | |
| - name: "[macos] Install dependencies" | |
| run: | | |
| brew install tmux | |
| tmux -V | |
| locale | |
| if: runner.os == 'macOS' | |
| env: | |
| HOMEBREW_NO_AUTO_UPDATE: 1 | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 1 | |
| - run: rustup toolchain install | |
| - uses: taiki-e/install-action@v2 | |
| with: | |
| tool: nextest@0.9 | |
| - uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-llvm-cov@0.8 | |
| - name: Cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Run doctests | |
| run: cargo test --doc | |
| - name: Run tests | |
| # Do not use `--all-targets` to avoid running benches | |
| run: cargo llvm-cov nextest --release --features test-utils --bins --lib --examples --tests --codecov --output-path codecov.json | |
| env: | |
| LC_ALL: en_US.UTF-8 | |
| TERM: xterm-256color | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: codecov.json | |
| fail_ci_if_error: false | |
| continue-on-error: true | |
| - name: Upload test results to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| report_type: test_results | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: target/nextest/default/junit.xml | |
| fail_ci_if_error: false | |
| continue-on-error: true | |
| clippy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 1 | |
| - run: rustup toolchain install | |
| - name: Cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Clippy | |
| run: cargo clippy | |
| rustfmt: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - run: rustup toolchain install | |
| - name: Check formatting | |
| run: | | |
| cargo fmt --all -- --check | |
| build-no-default-features: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - run: rustup toolchain install | |
| - name: Cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Build without any feature | |
| run: | | |
| cargo build --no-default-features |