Skip to content

Commit

Permalink
Remove .cargo/config.toml and set link compiler on CI with CARGO_TARG…
Browse files Browse the repository at this point in the history
…ET_<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 <github@yubiuser.dev>
  • Loading branch information
yubiuser authored Sep 13, 2024
1 parent 4f9151c commit b85bab5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
3 changes: 0 additions & 3 deletions .cargo/config.toml

This file was deleted.

23 changes: 18 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ jobs:
- run: cargo hack check --each-feature

test-windows:
needs: test-linux
needs: clippy
name: cargo +${{ matrix.toolchain }} check (${{ matrix.os }})
runs-on: ${{ matrix.os }}
continue-on-error: false
Expand Down Expand Up @@ -201,7 +201,7 @@ jobs:

test-cross-arm:
name: cross +${{ matrix.toolchain }} build ${{ matrix.target }}
needs: test-linux
needs: clippy
runs-on: ${{ matrix.os }}
continue-on-error: false
strategy:
Expand Down Expand Up @@ -234,11 +234,24 @@ jobs:
target
key: ${{ runner.os }}-${{ matrix.target }}-${{ steps.get-rustc-version.outputs.version }}-${{ hashFiles('Cargo.lock') }}

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

- name: Install cross compiler toolchain
run: sudo apt-get install -y gcc-arm-linux-gnueabihf
- name: Install cross compiler
run: |
if [ ${{ matrix.target }} = "armv7-unknown-linux-gnueabihf" ]; then
sudo apt-get install -y gcc-arm-linux-gnueabihf
fi
- name: Set target link compiler
run: |
# Convert target to uppercase and replace - with _
target=${{ matrix.target }}
target=${target^^}
target=${target//-/_}
if [ ${{ matrix.target }} = "armv7-unknown-linux-gnueabihf" ]; then
echo "CARGO_TARGET_${target}_LINKER=arm-linux-gnueabihf-gcc" >> $GITHUB_ENV
fi
- name: Build
run: cargo build --verbose --target ${{ matrix.target }} --no-default-features
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
target
.cargo
spotify_appkey.key
.vagrant/
.project
Expand Down

0 comments on commit b85bab5

Please sign in to comment.