@@ -26,10 +26,7 @@ jobs:
26 uses: actions/checkout@v3
26 uses: actions/checkout@v3
28 - name: Install stable toolchain
28 - name: Install stable toolchain
29− uses: helix-editor/rust-toolchain@v1
29+ uses: dtolnay/rust-toolchain@stable
34 - uses: Swatinem/rust-cache@v2
31 - uses: Swatinem/rust-cache@v2
@@ -47,6 +44,16 @@ jobs:
48 name: Dist
45 name: Dist
49 needs: [fetch-grammars]
46 needs: [fetch-grammars]
48+ # For some builds, we use cross to test on 32-bit and big-endian
51+ # When CARGO is set to CROSS, this is set to `--target matrix.target`.
53+ # When CARGO is set to CROSS, TARGET_DIR includes matrix.target.
55+ # Emit backtraces on panics.
50 runs-on: ${{ matrix.os }}
57 runs-on: ${{ matrix.os }}
52 fail-fast: false # don't fail other jobs if one fails
59 fail-fast: false # don't fail other jobs if one fails
@@ -107,12 +114,10 @@ jobs:
107 tar xJf grammars/grammars.tar.xz -C runtime/grammars/sources
114 tar xJf grammars/grammars.tar.xz -C runtime/grammars/sources
109 - name: Install ${{ matrix.rust }} toolchain
116 - name: Install ${{ matrix.rust }} toolchain
110− uses: actions-rs/toolchain@v1
117+ uses: dtolnay/rust-toolchain@master
113 toolchain: ${{ matrix.rust }}
119 toolchain: ${{ matrix.rust }}
114 target: ${{ matrix.target }}
120 target: ${{ matrix.target }}
117 # Install a pre-release version of Cross
122 # Install a pre-release version of Cross
118 # TODO: We need to pre-install Cross because we need cross-rs/cross#591 to
123 # TODO: We need to pre-install Cross because we need cross-rs/cross#591 to
@@ -120,15 +125,20 @@ jobs:
120 # 0.3.0, which includes cross-rs/cross#591, is released.
125 # 0.3.0, which includes cross-rs/cross#591, is released.
121 - name: Install Cross
126 - name: Install Cross
122 if: "matrix.cross"
127 if: "matrix.cross"
123− run: cargo install cross --git https://github.com/cross-rs/cross.git --rev 47df5c76e7cba682823a0b6aa6d95c17b31ba63a
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
134+ - name: Show command used for Cargo
136+ echo "cargo command is: ${{ env.CARGO }}"
137+ echo "target flag is: ${{ env.TARGET_FLAGS }}"
125 - name: Run cargo test
139 - name: Run cargo test
126− uses: actions-rs/cargo@v1
127 if: "!matrix.skip_tests"
140 if: "!matrix.skip_tests"
129− use-cross: ${{ matrix.cross }}
131− args: --release --locked --target ${{ matrix.target }} --workspace
141+ run: ${{ env.CARGO }} test --release --locked --target ${{ matrix.target }} --workspace
133 - name: Set profile.release.strip = true
143 - name: Set profile.release.strip = true
134 shell: bash
144 shell: bash
@@ -139,11 +149,7 @@ jobs:
141 - name: Build release binary
151 - name: Build release binary
142− uses: actions-rs/cargo@v1
144− use-cross: ${{ matrix.cross }}
146− args: --release --locked --target ${{ matrix.target }}
152+ run: ${{ env.CARGO }} build --release --locked --target ${{ matrix.target }}
148 - name: Build AppImage
154 - name: Build AppImage
149 shell: bash
155 shell: bash