on master help sign in
Use dtolnay/rust-toolchain in more places
00092a2Blaž Hrastnik
.github/workflows/build.yml+2−7
@@ -44,10 +44,7 @@ jobs:
44 uses: actions/checkout@v3
44 uses: actions/checkout@v3
45
45
46 - name: Install stable toolchain
46 - name: Install stable toolchain
47− uses: helix-editor/rust-toolchain@v1
47+ uses: dtolnay/rust-toolchain@1.61
48− with:
49− profile: minimal
50− override: true
51
48
52 - uses: Swatinem/rust-cache@v2
49 - uses: Swatinem/rust-cache@v2
53
50
@@ -76,10 +73,8 @@ jobs:
76 uses: actions/checkout@v3
73 uses: actions/checkout@v3
77
74
78 - name: Install stable toolchain
75 - name: Install stable toolchain
79− uses: helix-editor/rust-toolchain@v1
76+ uses: dtolnay/rust-toolchain@1.61
80 with:
77 with:
81− profile: minimal
82− override: true
83 components: rustfmt, clippy
78 components: rustfmt, clippy
84
79
85 - uses: Swatinem/rust-cache@v2
80 - uses: Swatinem/rust-cache@v2
.github/workflows/release.yml+24−18
@@ -26,10 +26,7 @@ jobs:
26 uses: actions/checkout@v3
26 uses: actions/checkout@v3
27
27
28 - name: Install stable toolchain
28 - name: Install stable toolchain
29− uses: helix-editor/rust-toolchain@v1
29+ uses: dtolnay/rust-toolchain@stable
30− with:
31− profile: minimal
32− override: true
33
30
34 - uses: Swatinem/rust-cache@v2
31 - uses: Swatinem/rust-cache@v2
35
32
@@ -47,6 +44,16 @@ jobs:
47 dist:
44 dist:
48 name: Dist
45 name: Dist
49 needs: [fetch-grammars]
46 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
50 runs-on: ${{ matrix.os }}
57 runs-on: ${{ matrix.os }}
51 strategy:
58 strategy:
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
108
115
109 - name: Install ${{ matrix.rust }} toolchain
116 - name: Install ${{ matrix.rust }} toolchain
110− uses: actions-rs/toolchain@v1
117+ uses: dtolnay/rust-toolchain@master
111 with:
118 with:
112− profile: minimal
113 toolchain: ${{ matrix.rust }}
119 toolchain: ${{ matrix.rust }}
114 target: ${{ matrix.target }}
120 target: ${{ matrix.target }}
115− override: true
116
121
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"
128+ run: |
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
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 }}"
124
138
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"
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
132
142
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:
139 EOF
149 EOF
140
150
141 - name: Build release binary
151 - 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 }}
147
153
148 - name: Build AppImage
154 - name: Build AppImage
149 shell: bash
155 shell: bash