Skip to content

Commit

Permalink
Change target folder for native cpu build in CI
Browse files Browse the repository at this point in the history
GitHub Actions seems to have started scanning executables. However while
the scan is still in progress, we redo the build for the native CPU.
Cargo will then try to replace the previously built executable and fail
because the scan is still in progress. By switching the target folder
for the native build, we can avoid this problem.
  • Loading branch information
CryZe committed Sep 13, 2021
1 parent 9352715 commit 6419c50
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@ jobs:
matrix:
rust:
# x86 without sse/sse2 on by default
- { target: i586-pc-windows-msvc, toolchain: 1.52.0, os: windows-latest }
- { target: i586-pc-windows-msvc, toolchain: 1.52.1, os: windows-latest }
- { target: i586-pc-windows-msvc, toolchain: stable, os: windows-latest }
- { target: i586-pc-windows-msvc, toolchain: beta, os: windows-latest }
- { target: i586-pc-windows-msvc, toolchain: nightly, os: windows-latest }
# x86
- { target: i686-pc-windows-msvc, toolchain: 1.52.0, os: windows-latest }
- { target: i686-pc-windows-msvc, toolchain: 1.52.1, os: windows-latest }
- { target: i686-pc-windows-msvc, toolchain: stable, os: windows-latest }
- { target: i686-pc-windows-msvc, toolchain: beta, os: windows-latest }
- { target: i686-pc-windows-msvc, toolchain: nightly, os: windows-latest }
# x86_64
- { target: x86_64-pc-windows-msvc, toolchain: 1.52.0, os: windows-latest }
- { target: x86_64-pc-windows-msvc, toolchain: 1.52.1, os: windows-latest }
- { target: x86_64-pc-windows-msvc, toolchain: stable, os: windows-latest }
- { target: x86_64-pc-windows-msvc, toolchain: beta, os: windows-latest }
- { target: x86_64-pc-windows-msvc, toolchain: nightly, os: windows-latest }
## arm
#- { target: arm-unknown-linux-gnueabihf, toolchain: 1.52.0, os: ubuntu-latest }
#- { target: arm-unknown-linux-gnueabihf, toolchain: 1.52.1, os: ubuntu-latest }
#- { target: arm-unknown-linux-gnueabihf, toolchain: stable, os: ubuntu-latest }
#- { target: arm-unknown-linux-gnueabihf, toolchain: beta, os: ubuntu-latest }
#- { target: arm-unknown-linux-gnueabihf, toolchain: nightly, os: ubuntu-latest }
## aarch64
#- { target: aarch64-unknown-linux-gnu, toolchain: 1.52.0, os: ubuntu-latest }
#- { target: aarch64-unknown-linux-gnu, toolchain: 1.52.1, os: ubuntu-latest }
#- { target: aarch64-unknown-linux-gnu, toolchain: stable, os: ubuntu-latest }
#- { target: aarch64-unknown-linux-gnu, toolchain: beta, os: ubuntu-latest }
#- { target: aarch64-unknown-linux-gnu, toolchain: nightly, os: ubuntu-latest }
Expand Down Expand Up @@ -75,6 +75,11 @@ jobs:
- name: Test with 'native' CPU features + No Default Cargo Features
if: matrix.rust.target == 'i586-pc-windows-msvc' || matrix.rust.target == 'i686-pc-windows-msvc' || matrix.rust.target == 'x86_64-pc-windows-msvc' || matrix.rust.target == 'wasm32-wasi'
run: cargo test --target ${{ matrix.rust.target }} --no-default-features
env:
CARGO_TARGET_DIR: "target-native"

- name: Test with 'native' CPU features + All Cargo Features
if: matrix.rust.target == 'i586-pc-windows-msvc' || matrix.rust.target == 'i686-pc-windows-msvc' || matrix.rust.target == 'x86_64-pc-windows-msvc' || matrix.rust.target == 'wasm32-wasi'
run: cargo test --target ${{ matrix.rust.target }} --all-features
env:
CARGO_TARGET_DIR: "target-native"

0 comments on commit 6419c50

Please sign in to comment.