Skip to content

Commit b85bab5

Browse files
authored
Remove .cargo/config.toml and set link compiler on CI with CARGO_TARGET_<triple>_LINKER (#1333)
* Remove .cargo/config.toml and set link compiler on CI with CARGO_TARGET_<triple>_LINKER * Run windows and cross builds parallel to linux tests Signed-off-by: yubiuser <[email protected]>
1 parent 4f9151c commit b85bab5

3 files changed

Lines changed: 19 additions & 8 deletions

File tree

.cargo/config.toml

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ jobs:
154154
- run: cargo hack check --each-feature
155155

156156
test-windows:
157-
needs: test-linux
157+
needs: clippy
158158
name: cargo +${{ matrix.toolchain }} check (${{ matrix.os }})
159159
runs-on: ${{ matrix.os }}
160160
continue-on-error: false
@@ -201,7 +201,7 @@ jobs:
201201

202202
test-cross-arm:
203203
name: cross +${{ matrix.toolchain }} build ${{ matrix.target }}
204-
needs: test-linux
204+
needs: clippy
205205
runs-on: ${{ matrix.os }}
206206
continue-on-error: false
207207
strategy:
@@ -234,11 +234,24 @@ jobs:
234234
target
235235
key: ${{ runner.os }}-${{ matrix.target }}-${{ steps.get-rustc-version.outputs.version }}-${{ hashFiles('Cargo.lock') }}
236236

237-
- name: Install the cross compiler targets
237+
- name: Install the cross compiler rust targets
238238
run: rustup target add ${{ matrix.target }}
239239

240-
- name: Install cross compiler toolchain
241-
run: sudo apt-get install -y gcc-arm-linux-gnueabihf
240+
- name: Install cross compiler
241+
run: |
242+
if [ ${{ matrix.target }} = "armv7-unknown-linux-gnueabihf" ]; then
243+
sudo apt-get install -y gcc-arm-linux-gnueabihf
244+
fi
245+
246+
- name: Set target link compiler
247+
run: |
248+
# Convert target to uppercase and replace - with _
249+
target=${{ matrix.target }}
250+
target=${target^^}
251+
target=${target//-/_}
252+
if [ ${{ matrix.target }} = "armv7-unknown-linux-gnueabihf" ]; then
253+
echo "CARGO_TARGET_${target}_LINKER=arm-linux-gnueabihf-gcc" >> $GITHUB_ENV
254+
fi
242255
243256
- name: Build
244257
run: cargo build --verbose --target ${{ matrix.target }} --no-default-features

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
target
2+
.cargo
23
spotify_appkey.key
34
.vagrant/
45
.project

0 commit comments

Comments
 (0)