diff --git a/.github/workflows/test-workflow.yml b/.github/workflows/test-workflow.yml index 99f6b97..678f77b 100644 --- a/.github/workflows/test-workflow.yml +++ b/.github/workflows/test-workflow.yml @@ -40,9 +40,10 @@ jobs: - os: windows-latest target: i686-pc-windows-msvc use-cross: false - - os: windows-latest - target: aarch64-pc-windows-msvc - use-cross: false + # No available runner. Uncomment when available. + # - os: windows-latest + # target: aarch64-pc-windows-msvc + # use-cross: false - os: macos-13 # Intel target: x86_64-apple-darwin use-cross: false @@ -63,7 +64,7 @@ jobs: uses: actions/checkout@v4 with: repository: Sewer56/prs-rs - ref: d08599ed5473616f57d57a0966939e1a5dbda9b4 + ref: 149060527e685360687d7332742ac016b39af8a7 - name: Test Coverage Build uses: Reloaded-Project/devops-rust-test-and-coverage@v1-test with: @@ -84,7 +85,7 @@ jobs: uses: actions/checkout@v4 with: repository: Sewer56/prs-rs - ref: d08599ed5473616f57d57a0966939e1a5dbda9b4 + ref: 149060527e685360687d7332742ac016b39af8a7 - name: Test Nightly/Beta Build uses: Reloaded-Project/devops-rust-test-and-coverage@v1-test with: @@ -113,7 +114,7 @@ jobs: uses: actions/checkout@v4 with: repository: Sewer56/prs-rs - ref: d08599ed5473616f57d57a0966939e1a5dbda9b4 + ref: 149060527e685360687d7332742ac016b39af8a7 - name: Install Rust toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: @@ -134,7 +135,7 @@ jobs: uses: actions/checkout@v4 with: repository: Sewer56/prs-rs - ref: d08599ed5473616f57d57a0966939e1a5dbda9b4 + ref: 149060527e685360687d7332742ac016b39af8a7 - name: Test Skipping Rust Cache uses: Reloaded-Project/devops-rust-test-and-coverage@v1-test with: @@ -148,7 +149,7 @@ jobs: uses: actions/checkout@v4 with: repository: Sewer56/prs-rs - ref: d08599ed5473616f57d57a0966939e1a5dbda9b4 + ref: 149060527e685360687d7332742ac016b39af8a7 - name: Test Skipping Coverage Upload uses: Reloaded-Project/devops-rust-test-and-coverage@v1-test with: diff --git a/action.yml b/action.yml index bbc0b5f..59cc2ac 100644 --- a/action.yml +++ b/action.yml @@ -77,6 +77,23 @@ runs: workspaces: | ${{ inputs.rust-project-path }} -> target + - name: Install gcc-multilib (if on Ubuntu based System, and Target is not Host) + if: inputs.use-cross == 'false' && runner.os == 'Linux' + shell: bash + run: | + # Get host triple + HOST_TARGET=$(rustc -vV | sed -n 's|host: ||p') + echo "Host target: $HOST_TARGET" + echo "Target: ${{ inputs.target }}" + + if [ "$HOST_TARGET" != "${{ inputs.target }}" ]; then + echo "Target is different from host. Installing gcc-multilib..." + sudo apt-get update || true + sudo apt-get install -y gcc-multilib || true + else + echo "Target is the same as host. Skipping gcc-multilib installation." + fi + - name: Install cross if: inputs.use-cross == 'true' shell: bash @@ -91,16 +108,18 @@ runs: cargo +${{ inputs.rust-toolchain }} tarpaulin --all --out xml --engine llvm \ --features "${{ inputs.features }}" \ ${{ inputs.no-default-features == 'true' && '--no-default-features' || '' }} \ + ${{ inputs.target != '' && format('--target "{0}"', inputs.target) || '' }} \ ${{ inputs.additional-test-args }} - name: Run Tests with cross if: inputs.use-cross == 'true' shell: bash working-directory: ${{ inputs.rust-project-path }} - run: | + run: | cross +${{ inputs.rust-toolchain }} test --all \ --features "${{ inputs.features }}" \ ${{ inputs.no-default-features == 'true' && '--no-default-features' || '' }} \ + ${{ inputs.target != '' && format('--target "{0}"', inputs.target) || '' }} \ ${{ inputs.additional-test-args }} - name: Upload Coverage to Codecov