|
1 | | -name: Rust |
| 1 | +name: Rust checks |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | | - pull_request: |
6 | | - branches: [ main, develop ] |
| 5 | + # pull_request: |
| 6 | + # branches: [ main, develop ] |
7 | 7 |
|
8 | 8 | env: |
9 | 9 | CARGO_TERM_COLOR: always |
10 | 10 |
|
11 | 11 | jobs: |
12 | | - build: |
13 | | - |
14 | | - runs-on: ${{ matrix.os }} |
| 12 | + format: |
| 13 | + name: check the format of the code |
| 14 | + uses: ./.github/workflows/fmt.yml |
| 15 | + |
| 16 | + rustdoc-check: |
| 17 | + name: rustdoc check |
| 18 | + uses: ./.github/workflows/rust_doc_check.yml |
| 19 | + with: |
| 20 | + toolchain: stable |
| 21 | + |
| 22 | + rust_test: |
| 23 | + name: rust test |
| 24 | + needs: [format] |
15 | 25 | strategy: |
16 | 26 | matrix: |
17 | 27 | os: [ubuntu-latest, windows-latest] |
18 | 28 | profile: [test, release] |
19 | 29 | exclude: |
20 | 30 | - os: windows-latest |
21 | 31 | profile: release |
22 | | - steps: |
23 | | - - name: Checkout repository |
24 | | - uses: actions/checkout@v4 |
| 32 | + |
| 33 | + uses: ./.github/workflows/rust_test.yml |
| 34 | + with: |
| 35 | + features_flag_1: --features="serde-serialize" |
| 36 | + features_flag_2: --no-default-features --features="overflow-test" |
| 37 | + toolchain: stable |
| 38 | + os: ${{ matrix.os }} |
| 39 | + profile: ${{ matrix.profile }} |
| 40 | + # steps: |
| 41 | + # - name: Checkout repository |
| 42 | + # uses: actions/checkout@v4 |
25 | 43 |
|
26 | | - - name: Install Rust stable toolchain |
27 | | - uses: actions-rs/toolchain@v1 |
28 | | - with: |
29 | | - toolchain: stable |
30 | | - default: true |
| 44 | + # - name: Install Rust stable toolchain |
| 45 | + # uses: actions-rs/toolchain@v1 |
| 46 | + # with: |
| 47 | + # toolchain: stable |
| 48 | + # default: true |
31 | 49 |
|
32 | | - - name: Run tests with serd |
33 | | - run: cargo +stable test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --features="serde-serialize" |
| 50 | + # - name: Run tests with serd |
| 51 | + # run: cargo +stable test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --features="serde-serialize" |
34 | 52 |
|
35 | | - - name: Run examples tests with serd |
36 | | - run: cargo +stable test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --features="serde-serialize" --examples |
| 53 | + # - name: Run examples tests with serd |
| 54 | + # run: cargo +stable test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --features="serde-serialize" --examples |
37 | 55 |
|
38 | 56 | # it is faster to keep the going and reuse previous compilation artefact than using |
39 | 57 | # a matrix strategy and starting all over again |
40 | | - - name: Run tests no features |
41 | | - run: cargo +stable test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --no-default-features --features="overflow-test" |
| 58 | + # - name: Run tests no features |
| 59 | + # run: cargo +stable test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --no-default-features --features="overflow-test" |
42 | 60 |
|
43 | | - - name: Run examples tests no features |
44 | | - run: cargo +stable test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --no-default-features --features="overflow-test" --examples |
| 61 | + # - name: Run examples tests no features |
| 62 | + # run: cargo +stable test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --no-default-features --features="overflow-test" --examples |
45 | 63 |
|
46 | 64 | linter: |
47 | 65 | name: lint code on nightly release |
48 | | - runs-on: ubuntu-latest |
49 | | - |
50 | | - steps: |
51 | | - - name: Checkout repository |
52 | | - uses: actions/checkout@v4 |
53 | | - |
54 | | - - name: Install Rust nightly toolchain |
55 | | - uses: actions-rs/toolchain@v1 |
56 | | - with: |
57 | | - toolchain: nightly |
58 | | - components: clippy |
59 | | - default: true |
60 | | - |
61 | | - - name: Linter |
62 | | - run: cargo +nightly clippy --all --verbose --tests --all-features -- --no-deps --deny warnings |
63 | | - |
64 | | - - name: Linter release |
65 | | - run: cargo +nightly clippy --all --verbose --tests --release --all-features -- --no-deps --deny warnings |
| 66 | + needs: [format, rustdoc-check] |
| 67 | + uses: ./.github/workflows/clippy.yml |
| 68 | + with: |
| 69 | + features_flag: --all-features |
| 70 | + toolchain: nightly |
| 71 | + |
| 72 | + coverage: |
| 73 | + name: coverage |
| 74 | + uses: ./.github/workflows/coverage.yml |
| 75 | + with: |
| 76 | + profile_file_name_prefix: lattice-qcd-rs |
| 77 | + features_flag: --no-default-features --features="serde-serialize" |
| 78 | + |
| 79 | + benches: |
| 80 | + name: benches |
| 81 | + needs: [format, coverage, rust_test] |
| 82 | + if: ${{ github.ref_name == 'main' || github.ref_name == 'develop' }} |
| 83 | + uses: ./.github/workflows/benches.yml |
| 84 | + with: |
| 85 | + toolchain: stable |
| 86 | + |
| 87 | + doc_publish: |
| 88 | + name: publish rust doc |
| 89 | + needs: [format, coverage, rust_test, rustdoc-check, linter] |
| 90 | + if: ${{ github.ref_name == 'main' }} |
| 91 | + uses: ./.github/workflows/rust_doc_publish.yml |
| 92 | + with: |
| 93 | + toolchain: stable |
0 commit comments