From b85bab50950bf58d8af554b4b83b413ba573d2a8 Mon Sep 17 00:00:00 2001 From: yubiuser Date: Fri, 13 Sep 2024 07:40:22 +0200 Subject: [PATCH] Remove .cargo/config.toml and set link compiler on CI with CARGO_TARGET__LINKER (#1333) * Remove .cargo/config.toml and set link compiler on CI with CARGO_TARGET__LINKER * Run windows and cross builds parallel to linux tests Signed-off-by: yubiuser --- .cargo/config.toml | 3 --- .github/workflows/test.yml | 23 ++++++++++++++++++----- .gitignore | 1 + 3 files changed, 19 insertions(+), 8 deletions(-) delete mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml deleted file mode 100644 index 36056447..00000000 --- a/.cargo/config.toml +++ /dev/null @@ -1,3 +0,0 @@ - -[target.armv7-unknown-linux-gnueabihf] -linker = "arm-linux-gnueabihf-gcc" \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 66a430b4..30f58fed 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -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: @@ -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 diff --git a/.gitignore b/.gitignore index 8b5fdeb6..eebf401d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ target +.cargo spotify_appkey.key .vagrant/ .project