@@ -26,10 +26,7 @@ jobs:
2626 uses: actions/checkout@v3
2727
2828 - name: Install stable toolchain
29− uses: helix-editor/rust-toolchain@v1
30− with:
31− profile: minimal
32− override: true
29+ uses: dtolnay/rust-toolchain@stable
3330
3431 - uses: Swatinem/rust-cache@v2
3532
@@ -47,6 +44,16 @@ jobs:
4744 dist:
4845 name: Dist
4946 needs: [fetch-grammars]
47+ env:
48+ # For some builds, we use cross to test on 32-bit and big-endian
49+ # systems.
50+ CARGO: cargo
51+ # When CARGO is set to CROSS, this is set to `--target matrix.target`.
52+ TARGET_FLAGS:
53+ # When CARGO is set to CROSS, TARGET_DIR includes matrix.target.
54+ TARGET_DIR: ./target
55+ # Emit backtraces on panics.
56+ RUST_BACKTRACE: 1
5057 runs-on: ${{ matrix.os }}
5158 strategy:
5259 fail-fast: false # don't fail other jobs if one fails
@@ -107,12 +114,10 @@ jobs:
107114 tar xJf grammars/grammars.tar.xz -C runtime/grammars/sources
108115
109116 - name: Install ${{ matrix.rust }} toolchain
110− uses: actions-rs/toolchain@v1
117+ uses: dtolnay/rust-toolchain@master
111118 with:
112− profile: minimal
113119 toolchain: ${{ matrix.rust }}
114120 target: ${{ matrix.target }}
115− override: true
116121
117122 # Install a pre-release version of Cross
118123 # TODO: We need to pre-install Cross because we need cross-rs/cross#591 to
@@ -120,15 +125,20 @@ jobs:
120125 # 0.3.0, which includes cross-rs/cross#591, is released.
121126 - name: Install Cross
122127 if: "matrix.cross"
123− run: cargo install cross --git https://github.com/cross-rs/cross.git --rev 47df5c76e7cba682823a0b6aa6d95c17b31ba63a
128+ run: |
129+ cargo install cross --git https://github.com/cross-rs/cross.git --rev 47df5c76e7cba682823a0b6aa6d95c17b31ba63a
130+ echo "CARGO=cross" >> $GITHUB_ENV
131+ # echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
132+ # echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
133+
134+ - name: Show command used for Cargo
135+ run: |
136+ echo "cargo command is: ${{ env.CARGO }}"
137+ echo "target flag is: ${{ env.TARGET_FLAGS }}"
124138
125139 - name: Run cargo test
126− uses: actions-rs/cargo@v1
127140 if: "!matrix.skip_tests"
128− with:
129− use-cross: ${{ matrix.cross }}
130− command: test
131− args: --release --locked --target ${{ matrix.target }} --workspace
141+ run: ${{ env.CARGO }} test --release --locked --target ${{ matrix.target }} --workspace
132142
133143 - name: Set profile.release.strip = true
134144 shell: bash
@@ -139,11 +149,7 @@ jobs:
139149 EOF
140150
141151 - name: Build release binary
142− uses: actions-rs/cargo@v1
143− with:
144− use-cross: ${{ matrix.cross }}
145− command: build
146− args: --release --locked --target ${{ matrix.target }}
152+ run: ${{ env.CARGO }} build --release --locked --target ${{ matrix.target }}
147153
148154 - name: Build AppImage
149155 shell: bash