Add deps.rs badge #174
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: Rust | |
| on: [push, pull_request] | |
| # See https://rust-cli.github.io/book/tutorial/packaging.html#building-binary-releases-on-ci and | |
| # https://github.com/sharkdp/bat/blob/master/.github/workflows/CICD.yml for a more intricate CI/CD | |
| jobs: | |
| CI: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v1 | |
| - uses: actions-rs/clippy-check@v1 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| args: --locked --all-targets --all-features | |
| - name: Check | |
| run: cargo check --locked --all-targets --verbose | |
| - name: Check (features=debug) | |
| run: cargo check --locked --all-targets --verbose --features debug | |
| - name: Check Documentation | |
| env: | |
| RUSTDOCFLAGS: -D warnings | |
| run: cargo doc --locked --no-deps --document-private-items | |
| - name: Tests | |
| run: cargo test --locked --verbose | |
| - name: Tests (features=debug) | |
| run: cargo test --locked --verbose --features debug | |
| - name: Benchmark | |
| run: | | |
| cargo build --locked --release | |
| ./benchmark.sh --bkt=target/release/bkt -- --ttl=1m -- sleep 1 | |
| CD: | |
| needs: CI | |
| name: CD (${{ matrix.arch.target }} - ${{ matrix.arch.os }}) | |
| runs-on: ${{ matrix.arch.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| arch: | |
| - { target: aarch64-unknown-linux-gnu , os: ubuntu-20.04 , use-cross: true } | |
| - { target: arm-unknown-linux-gnueabihf , os: ubuntu-20.04 , use-cross: true } | |
| - { target: i686-unknown-linux-gnu , os: ubuntu-20.04 , use-cross: true } | |
| - { target: i686-unknown-linux-musl , os: ubuntu-20.04 , use-cross: true } | |
| # Note x86 does not appear to be supported past macos-13: https://github.com/actions/runner-images/issues/9741 | |
| - { target: x86_64-apple-darwin , os: macos-13 } | |
| - { target: aarch64-apple-darwin , os: macos-14 } | |
| - { target: x86_64-pc-windows-msvc , os: windows-2019 , suffix: .exe } | |
| - { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04 } | |
| - { target: x86_64-unknown-linux-musl , os: ubuntu-20.04 , use-cross: true } | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Extract crate information | |
| shell: bash | |
| run: | | |
| echo "PROJECT_NAME=$(sed -n 's/^name = "\(.*\)"/\1/p' Cargo.toml)" >> "$GITHUB_ENV" | |
| echo "PROJECT_VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)" >> "$GITHUB_ENV" | |
| - name: Build | |
| uses: actions-rs/cargo@v1 | |
| with: | |
| use-cross: ${{ matrix.arch.use-cross }} | |
| command: build | |
| args: --locked --release --target=${{ matrix.arch.target }} | |
| - name: Upload package artifact | |
| uses: actions/upload-artifact@master | |
| with: | |
| name: '${{ env.PROJECT_NAME }}.v${{ env.PROJECT_VERSION }}.${{ matrix.arch.target }}' | |
| path: 'target/${{ matrix.arch.target }}/release/${{ env.PROJECT_NAME }}${{ matrix.arch.suffix }}' |