ci #2267
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
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| merge_group: | |
| schedule: [cron: "40 1 * * *"] | |
| name: ci | |
| jobs: | |
| # build, test all supported targets | |
| build-test-stable: | |
| runs-on: ${{ matrix.job.os }} | |
| env: | |
| BUILD_CMD: cargo | |
| strategy: | |
| matrix: | |
| job: | |
| - { target: x86_64-unknown-linux-gnu, os: ubuntu-24.04, use-cross: true } | |
| - { target: armv7-unknown-linux-gnueabihf, os: ubuntu-24.04, use-cross: true } | |
| - { target: aarch64-unknown-linux-gnu, os: ubuntu-24.04, use-cross: true } | |
| toolchain: | |
| - stable | |
| # msrv | |
| - 1.84.0 | |
| steps: | |
| - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
| - name: Populate cache | |
| uses: ./.github/workflows/cache | |
| - name: Overwrite build command env variable | |
| if: matrix.job.use-cross | |
| shell: bash | |
| run: | | |
| echo "BUILD_CMD=cross" >> $GITHUB_ENV | |
| RUSTFLAGS="-C target-feature=-crt-static" cargo install cross --git https://github.com/cross-rs/cross | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.toolchain }} | |
| targets: ${{ matrix.job.target }} | |
| - run: $BUILD_CMD build --locked --workspace --target ${{ matrix.job.target }} | |
| - run: $BUILD_CMD test --locked --workspace --target ${{ matrix.job.target }} | |
| # fmt and clippy | |
| fmt-clippy: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| components: rustfmt, clippy | |
| - run: cargo fmt --all --check | |
| - run: cargo clippy --workspace -- -D warnings |