Skip to content

Commit

Permalink
Merge pull request #58 from shepmaster/maint
Browse files Browse the repository at this point in the history
  • Loading branch information
shepmaster authored Oct 18, 2023
2 parents 8d7e44a + 9726daa commit c02c240
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
34 changes: 23 additions & 11 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,27 @@ inputs:
required: false
type: string

cross-target:
default: ""
required: false
type: string

runs:
using: "composite"
steps:
- name: Install Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ inputs.toolchain }}
profile: minimal
default: true

- name: Install cross
if: ${{ inputs.cross-target != '' }}
shell: bash
run: |
cargo install cross --git https://github.com/cross-rs/cross
- name: Configure cross
if: ${{ inputs.cross-target != '' }}
shell: bash
run: |
cat > Cross.toml <<EOF
Expand All @@ -45,14 +55,16 @@ runs:
EOF
- name: Run tests
uses: actions-rs/cargo@v1
env:
RUSTFLAGS: "${{ env.RUSTFLAGS }} ${{ inputs.rustflags }}"
RUSTDOCFLAGS: "${{ env.RUSTDOCFLAGS }} ${{ inputs.rustdocflags }}"
with:
command: test
args: >-
--all
${{ inputs.features != '' && format('--features {0}', inputs.features) || '' }}
${{ inputs.target != '' && format('--target {0}', inputs.target) || '' }}
use-cross: ${{ inputs.target != '' }}
shell: bash
run: |
cmd=$([ -z "${{ inputs.cross-target }}" ] && echo 'cargo' || echo 'cross');
$cmd test \
--all \
${{ inputs.features != '' && format('--features {0}', inputs.features) || '' }} \
${{ inputs.target != '' && format('--target {0}', inputs.target) || '' }} \
${{ inputs.cross-target != '' && format('--target {0}', inputs.cross-target) || '' }} \
;
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
strategy:
matrix:
target_feature: ["-sse4.2", "+sse4.2"]
target: ["", "i686-unknown-linux-gnu"]
cross-target: ["", "i686-unknown-linux-gnu"]

runs-on: ubuntu-latest

Expand All @@ -65,7 +65,7 @@ jobs:
uses: ./.github/actions/test
with:
rustflags: "-C target-feature=${{ matrix.target_feature }}"
target: "${{ matrix.target }}"
cross-target: "${{ matrix.cross-target }}"

sanitizers:
runs-on: ubuntu-latest
Expand Down

0 comments on commit c02c240

Please sign in to comment.