Debian Codegraph @

debian/missing-sources/bytemuck/.github/workflows/rust.yml

raw symbols SCIP
1 name: Rust
2
3 on:
4 push: {}
5 pull_request: {}
6
7 env:
8 RUST_BACKTRACE: 1
9
10 jobs:
11 test:
12 name: Test Rust ${{ matrix.rust }} on ${{ matrix.os }}
13 runs-on: ${{ matrix.os }}
14 strategy:
15 matrix:
16 # it's a little tempting to use `matrix` to do a cartesian product with
17 # our `--feature` config here, but doing so will be very slow, as the
18 # free tier only supports up to 20 job runners at a time.
19 include:
20 # versions (all on linux-x86_64)
21 - { rust: 1.34.0, os: ubuntu-latest }
22 - { rust: 1.61.0, os: ubuntu-latest }
23 - { rust: stable, os: ubuntu-latest }
24 - { rust: beta, os: ubuntu-latest }
25 - { rust: nightly, os: ubuntu-latest }
26 # non-linux platforms (ones which don't require `cross`)
27 - { rust: stable, os: macos-latest }
28 - { rust: stable, os: windows-latest }
29 - { rust: stable-x86_64-gnu, os: windows-latest }
30 - { rust: stable-i686-msvc, os: windows-latest }
31 - { rust: stable-i686-gnu, os: windows-latest }
32 steps:
33 - uses: hecrj/setup-rust-action@v1
34 with:
35 rust-version: ${{ matrix.rust }}
36 - uses: actions/checkout@v3
37 - run: cargo test --verbose
38 - run: cargo test --verbose --no-default-features
39 - run: cargo test --verbose
40 - run: cargo test --verbose --features derive
41 if: matrix.rust == '1.61.0'
42 - run: cargo test --verbose --all-features
43 if: matrix.rust == 'nightly'
44 - run: cargo test --verbose --manifest-path=derive/Cargo.toml --all-features
45 if: matrix.rust == 'nightly'
46 - run: cd contiguous_bitset && cargo test
47 if: matrix.rust == 'stable'
48
49 cross-test:
50 name: Test on ${{ matrix.target }} with cross
51 runs-on: ubuntu-latest
52 strategy:
53 matrix:
54 # we once had mips runners for Big-endian coverage but those got demoted to tier 3.
55 target: [i686-unknown-linux-gnu]
56 steps:
57 - uses: hecrj/setup-rust-action@v1
58 with:
59 rust-version: nightly
60 - uses: actions/checkout@v3
61 - run: cargo install cross
62 - run: cross test --verbose --target=${{ matrix.target }} --no-default-features
63 - run: cross test --verbose --target=${{ matrix.target }}
64 - run: cross test --verbose --target=${{ matrix.target }} --all-features
65 if: matrix.rust == 'nightly'
66 - run: cross test --verbose --target=${{ matrix.target }} --manifest-path=derive/Cargo.toml --all-features
67 if: matrix.rust == 'nightly'
68
69 miri-test:
70 name: Test with miri
71 runs-on: ubuntu-latest
72 steps:
73 - uses: hecrj/setup-rust-action@v1
74 with:
75 rust-version: nightly
76 components: miri
77 - uses: actions/checkout@v3
78 # Note(Lokathor): We got some cached json errors, and so we cargo clean for this run.
79 - run: rm -fr target
80 - run: cargo miri test --verbose --no-default-features
81 - run: cargo miri test --verbose --all-features
82 - run: cd derive && rm -fr target && cargo miri test --verbose --all-features
83
84 sanitizer-test:
85 name: Test with -Zsanitizer=${{ matrix.sanitizer }}
86 runs-on: ubuntu-latest
87 strategy:
88 fail-fast: false
89 matrix:
90 # leak is disabled because the config got outdated
91 # and bytemuck doesn't really do allocation anyway.
92 sanitizer: [address, memory]
93 steps:
94 - uses: actions/checkout@v3
95 - uses: hecrj/setup-rust-action@v1
96 with:
97 rust-version: nightly
98 components: rust-src
99 - name: Test with sanitizer
100 env:
101 RUSTFLAGS: -Zsanitizer=${{ matrix.sanitizer }}
102 RUSTDOCFLAGS: -Zsanitizer=${{ matrix.sanitizer }}
103 ASAN_OPTIONS: detect_stack_use_after_return=1
104 # Asan's leak detection occasionally complains about some small leaks if
105 # backtraces are captured.
106 RUST_BACKTRACE: 0
107 # We don't run `derive`'s unit tests here the way we do elsewhere (for
108 # example, in `miri-test` above), as at the moment we can't easily build
109 # the `proc_macro` runtime with sanitizers on. IIUC doing this would
110 # require a custom rustc build, and... lol nope.
111 #
112 # This would mean only part of the code running under the sanitizer would
113 # actually include the sanitizer's checks, which is a recipe for false
114 # positives, so we just skip it, the generated code is what we care
115 # about anyway.
116 run: |
117 cargo test -Zbuild-std --verbose --target=x86_64-unknown-linux-gnu --no-default-features
118 cargo test -Zbuild-std --verbose --target=x86_64-unknown-linux-gnu --all-features