Skip to content

Commit

Permalink
Added: Missing Target from Tarpaulin and Cross Invocations
Browse files Browse the repository at this point in the history
And test against new commit with fixed 32-bit tests.
  • Loading branch information
Sewer56 committed Jun 21, 2024
1 parent c537870 commit 7fe01d2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 9 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down
21 changes: 20 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 7fe01d2

Please sign in to comment.