|
| 1 | +name: Rust |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master ] |
| 6 | + pull_request: |
| 7 | + branches: [ master ] |
| 8 | + |
| 9 | +env: |
| 10 | + CARGO_INCREMENTAL: 0 |
| 11 | + CARGO_TERM_COLOR: always |
| 12 | + RUST_BACKTRACE: 1 |
| 13 | + RUSTFLAGS: -D warnings |
| 14 | + RUSTDOCFLAGS: -D warnings --cfg docsrs |
| 15 | + |
| 16 | +jobs: |
| 17 | + build: |
| 18 | + runs-on: ubuntu-latest |
| 19 | + strategy: |
| 20 | + matrix: |
| 21 | + rust: |
| 22 | + - stable |
| 23 | + - beta |
| 24 | + - nightly |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@v2 |
| 27 | + - name: Install toolchain |
| 28 | + uses: actions-rs/toolchain@v1 |
| 29 | + with: |
| 30 | + toolchain: ${{ matrix.rust }} |
| 31 | + override: true |
| 32 | + components: rustfmt, clippy |
| 33 | + - name: Build |
| 34 | + run: cargo build --verbose |
| 35 | + - name: Run tests with all features |
| 36 | + run: cargo test --all-features --verbose |
| 37 | + - name: Run tests without features |
| 38 | + run: cargo test --no-default-features --verbose |
| 39 | + - name: Package |
| 40 | + run: cargo package |
| 41 | + - name: Test package |
| 42 | + run: cd $(find target/package/ -maxdepth 1 -mindepth 1 -type d) && cargo test |
| 43 | + - name: Test package without features |
| 44 | + run: cd $(find target/package/ -maxdepth 1 -mindepth 1 -type d) && cargo test --no-default-features |
| 45 | + - name: Build docs |
| 46 | + if: matrix.rust == 'nightly' |
| 47 | + run: cargo doc --all-features --verbose |
| 48 | + - name: Check formatting |
| 49 | + if: matrix.rust == 'stable' |
| 50 | + run: cargo fmt --all --check |
| 51 | + - name: Check clippy |
| 52 | + if: matrix.rust == 'stable' |
| 53 | + run: cargo clippy --all-features --lib --tests --examples --verbose |
| 54 | + - name: Check benchmarks with clippy |
| 55 | + if: matrix.rust == 'nightly' |
| 56 | + run: cargo clippy --all-features --benches --verbose |
| 57 | + - name: Check fuzz tests with clippy |
| 58 | + if: matrix.rust == 'stable' |
| 59 | + working-directory: fuzz |
| 60 | + run: cargo clippy --all-features --all-targets --verbose |
| 61 | + - name: Check fuzz tests formatting |
| 62 | + if: matrix.rust == 'stable' |
| 63 | + working-directory: fuzz |
| 64 | + run: cargo fmt --all --check |
| 65 | + msrv: |
| 66 | + runs-on: ubuntu-latest |
| 67 | + steps: |
| 68 | + - uses: actions/checkout@v2 |
| 69 | + - name: Install msrv toolchain |
| 70 | + |
| 71 | + - name: Use tinyvec 1.6.0 |
| 72 | + run: cargo update -p tinyvec --precise 1.6.0 |
| 73 | + - name: Build |
| 74 | + run: cargo build --verbose --all-features |
| 75 | + regen: |
| 76 | + runs-on: ubuntu-latest |
| 77 | + steps: |
| 78 | + - uses: actions/checkout@v3 |
| 79 | + - uses: actions/setup-python@v5 |
| 80 | + with: |
| 81 | + python-version: '3.12' |
| 82 | + - name: Regen |
| 83 | + run: cd scripts && python3 unicode.py |
| 84 | + - name: Diff tables |
| 85 | + run: diff src/tables.rs scripts/tables.rs |
| 86 | + - name: Diff tests |
| 87 | + run: diff tests/data/normalization_tests.rs scripts/normalization_tests.rs |
0 commit comments