update typed-builder and improve ci #677
Workflow file for this run
This file contains 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: Test and Build Rust | |
on: | |
push: | |
pull_request: | |
types: [opened, reopened] | |
schedule: | |
# Check if it works with current dependencies | |
- cron: "32 2 * * 3" # weekly on Wednesday 2:32 UTC | |
jobs: | |
rustfmt: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Rust | |
shell: bash -eux {0} | |
run: | | |
rm ~/.cargo/bin/{rustfmt,cargo-fmt} | |
rustup toolchain install stable --profile minimal --component rustfmt | |
rustup default stable | |
- uses: actions/checkout@v4 | |
- run: cargo fmt --check --verbose | |
test: | |
name: Test ${{ matrix.toolchain }} ${{ matrix.os }} ${{ matrix.features }} | |
runs-on: ${{ matrix.os }} | |
continue-on-error: ${{ matrix.toolchain == 'nightly' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: | |
- stable | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
clippyargs: | |
- -D clippy::pedantic -D warnings | |
features: | |
- --no-default-features | |
- "" # default features | |
- --all-features | |
include: | |
# Check future versions and maybe get some glances on soon to be lints | |
- toolchain: beta | |
os: ubuntu-latest | |
features: --all-features | |
clippyargs: -W clippy::pedantic -W clippy::cargo | |
- toolchain: nightly | |
os: ubuntu-latest | |
features: --all-features | |
clippyargs: -W clippy::pedantic | |
steps: | |
- name: Setup Rust | |
shell: bash -eux {0} | |
run: | | |
rustup toolchain install ${{ matrix.toolchain }} --profile minimal --component clippy | |
rustup default ${{ matrix.toolchain }} | |
- uses: actions/checkout@v4 | |
- name: Fetch dependencies | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fetch | |
args: --verbose | |
- name: Check clippy | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: --verbose --all-targets ${{ matrix.features }} -- ${{ matrix.clippyargs }} | |
- name: Check docs | |
uses: actions-rs/cargo@v1 | |
with: | |
command: doc | |
args: --verbose --no-deps ${{ matrix.features }} | |
- name: Run tests | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --verbose ${{ matrix.features }} | |
release: | |
name: Release ${{ matrix.triple }} | |
runs-on: ${{ matrix.os }} | |
needs: test | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- triple: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
- triple: aarch64-unknown-linux-gnu | |
os: ubuntu-latest | |
- triple: armv7-unknown-linux-gnueabihf | |
os: ubuntu-latest | |
- triple: arm-unknown-linux-gnueabihf | |
os: ubuntu-latest | |
- triple: x86_64-apple-darwin | |
os: macos-latest | |
- triple: aarch64-apple-darwin | |
os: macos-latest | |
- triple: x86_64-pc-windows-msvc | |
os: windows-latest | |
# https://github.com/briansmith/ring/issues/1167 | |
# - triple: aarch64-pc-windows-msvc | |
# os: windows-latest | |
steps: | |
- name: Setup Rust | |
shell: bash -eux {0} | |
run: | | |
rustup toolchain install stable --profile minimal --target ${{ matrix.triple }} | |
rustup default stable | |
- uses: actions/checkout@v4 | |
- name: Fetch dependencies | |
run: cargo fetch --verbose | |
- name: Build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --verbose --all-features --target ${{ matrix.triple }} | |
use-cross: ${{ runner.os == 'Linux' }} |