|
33 | 33 | HOST_TARGET: ${{ matrix.host_target }} |
34 | 34 | steps: |
35 | 35 | - uses: actions/checkout@v4 |
36 | | - |
37 | | - - name: Show Rust version (stable toolchain) |
38 | | - run: | |
39 | | - rustup show |
40 | | - rustc -Vv |
41 | | - cargo -V |
42 | | -
|
43 | | - # Cache the global cargo directory, but NOT the local `target` directory which |
44 | | - # we cannot reuse anyway when the nightly changes (and it grows quite large |
45 | | - # over time). |
46 | | - - name: Add cache for cargo |
47 | | - id: cache |
48 | | - uses: actions/cache@v4 |
49 | | - with: |
50 | | - path: | |
51 | | - # Taken from <https://doc.rust-lang.org/nightly/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci>. |
52 | | - # Cache package/registry information |
53 | | - ~/.cargo/registry/index |
54 | | - ~/.cargo/registry/cache |
55 | | - ~/.cargo/git/db |
56 | | - # Cache installed binaries |
57 | | - ~/.cargo/bin |
58 | | - ~/.cargo/.crates.toml |
59 | | - ~/.cargo/.crates2.json |
60 | | - key: cargo-${{ runner.os }}-reset20240425-${{ hashFiles('**/Cargo.lock') }} |
61 | | - restore-keys: cargo-${{ runner.os }}-reset20240425 |
62 | | - |
63 | | - - name: Install tools |
64 | | - if: steps.cache.outputs.cache-hit != 'true' |
65 | | - run: cargo install -f rustup-toolchain-install-master hyperfine |
66 | | - |
67 | | - - name: Install miri toolchain |
68 | | - run: | |
69 | | - if [[ ${{ github.event_name }} == 'schedule' ]]; then |
70 | | - echo "Building against latest rustc git version" |
71 | | - git ls-remote https://github.com/rust-lang/rust/ HEAD | cut -f 1 > rust-version |
72 | | - fi |
73 | | - ./miri toolchain --host ${{ matrix.host_target }} |
74 | | -
|
75 | | - - name: Show Rust version (miri toolchain) |
76 | | - run: | |
77 | | - rustup show |
78 | | - rustc -Vv |
79 | | - cargo -V |
| 36 | + - uses: ./.github/workflows/setup |
80 | 37 |
|
81 | 38 | # The `style` job only runs on Linux; this makes sure the Windows-host-specific |
82 | 39 | # code is also covered by clippy. |
|
92 | 49 | runs-on: ubuntu-latest |
93 | 50 | steps: |
94 | 51 | - uses: actions/checkout@v4 |
95 | | - |
96 | | - # This is exactly duplicated from above. GHA is pretty terrible when it comes |
97 | | - # to avoiding code duplication. |
98 | | - |
99 | | - # Cache the global cargo directory, but NOT the local `target` directory which |
100 | | - # we cannot reuse anyway when the nightly changes (and it grows quite large |
101 | | - # over time). |
102 | | - - name: Add cache for cargo |
103 | | - id: cache |
104 | | - uses: actions/cache@v4 |
105 | | - with: |
106 | | - path: | |
107 | | - # Taken from <https://doc.rust-lang.org/nightly/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci>. |
108 | | - # Cache package/registry information |
109 | | - ~/.cargo/registry/index |
110 | | - ~/.cargo/registry/cache |
111 | | - ~/.cargo/git/db |
112 | | - # Cache installed binaries |
113 | | - ~/.cargo/bin |
114 | | - ~/.cargo/.crates.toml |
115 | | - ~/.cargo/.crates2.json |
116 | | - key: cargo-${{ runner.os }}-reset20240331-${{ hashFiles('**/Cargo.lock') }} |
117 | | - restore-keys: cargo-${{ runner.os }}-reset20240331 |
118 | | - |
119 | | - - name: Install rustup-toolchain-install-master |
120 | | - if: steps.cache.outputs.cache-hit != 'true' |
121 | | - run: cargo install -f rustup-toolchain-install-master |
122 | | - |
123 | | - - name: Install "master" toolchain |
124 | | - run: | |
125 | | - if [[ ${{ github.event_name }} == 'schedule' ]]; then |
126 | | - echo "Building against latest rustc git version" |
127 | | - git ls-remote https://github.com/rust-lang/rust/ HEAD | cut -f 1 > rust-version |
128 | | - fi |
129 | | - ./miri toolchain |
130 | | -
|
131 | | - - name: Show Rust version |
132 | | - run: | |
133 | | - rustup show |
134 | | - rustc -Vv |
135 | | - cargo -V |
| 52 | + - uses: ./.github/workflows/setup |
136 | 53 |
|
137 | 54 | - name: rustfmt |
138 | 55 | run: ./miri fmt --check |
|
0 commit comments