Build and test #373
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 and test | |
| on: | |
| schedule: | |
| - cron: "0 0 * * 1,5" | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| pull_request: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_VERSION: 1.87.0 | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ["ubuntu-22.04", "macos-14"] | |
| feature: ["--all-features", ""] | |
| build: ["--release", ""] | |
| env: | |
| INSTALL_DEPS_CMD: install-deps-${{ contains(matrix.os, 'ubuntu') && 'ubuntu' || 'macos' }} | |
| J4RS_CONSOLE_LOG_LEVEL: warn | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: ${{ env.RUST_VERSION }} | |
| components: clippy, rustfmt | |
| - name: Cache sample slide | |
| id: cache-slide | |
| uses: actions/cache@v4 | |
| with: | |
| path: tests/assets/ | |
| key: slides-test | |
| - name: Download sample tests data | |
| if: steps.cache-slide.outputs.cache-hit != 'true' | |
| run: make dl-test-images | |
| - name: Install dependencies | |
| run: make ${{ env.INSTALL_DEPS_CMD }} | |
| - name: Build & Test | |
| run: cargo test --workspace ${{ matrix.build }} ${{ matrix.feature }} | |
| doc-rs: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: ${{ env.RUST_VERSION }} | |
| components: clippy, rustfmt | |
| - name: Install dependencies ubuntu | |
| run: make install-deps-ubuntu | |
| - name: Generate Doc | |
| env: | |
| DOCS_RS: 1 | |
| run: cargo doc -v | |
| pre-commit: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: ${{ env.RUST_VERSION }} | |
| override: true | |
| components: rustfmt, clippy | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.14' | |
| - name: Install pre-commit | |
| run: pip install pre-commit | |
| - name: Pre-commit | |
| run: | | |
| pre-commit install --install-hooks | |
| pre-commit run --all --show-diff-on-failure |