mirror of
https://github.com/chmln/sd
synced 2024-11-22 03:03:03 +00:00
Actually use the build target intended for each CI job (#252)
This commit is contained in:
parent
4a54433860
commit
20b1459a42
2 changed files with 22 additions and 7 deletions
16
.github/workflows/publish.yml
vendored
16
.github/workflows/publish.yml
vendored
|
@ -66,7 +66,13 @@ jobs:
|
|||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
|
||||
- name: Install Cross
|
||||
- name: Setup native compilation
|
||||
if: ${{ matrix.use-cross == false }}
|
||||
shell: bash
|
||||
run: |
|
||||
echo "CARGO=cargo" >> $GITHUB_ENV
|
||||
|
||||
- name: Setup cross compilation
|
||||
if: ${{ matrix.use-cross == true }}
|
||||
shell: bash
|
||||
run: |
|
||||
|
@ -77,12 +83,14 @@ jobs:
|
|||
curl -LO "https://github.com/cross-rs/cross/releases/download/v0.2.5/cross-x86_64-unknown-linux-musl.tar.gz"
|
||||
tar xf cross-x86_64-unknown-linux-musl.tar.gz
|
||||
echo "CARGO=cross" >> $GITHUB_ENV
|
||||
echo "RUSTFLAGS='--cfg sd_cross_compile'"
|
||||
echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
|
||||
echo "RUSTFLAGS=--cfg sd_cross_compile" >> $GITHUB_ENV
|
||||
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Build
|
||||
shell: bash
|
||||
run: |
|
||||
cargo build --release --locked
|
||||
$CARGO --version
|
||||
$CARGO build --release --locked --target ${{ matrix.target }}
|
||||
|
||||
- name: Upload binaries to release
|
||||
uses: svenstaro/upload-release-action@2.7.0
|
||||
|
|
13
.github/workflows/test.yml
vendored
13
.github/workflows/test.yml
vendored
|
@ -60,6 +60,12 @@ jobs:
|
|||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
|
||||
- name: Setup native compilation
|
||||
if: ${{ matrix.use-cross == false }}
|
||||
shell: bash
|
||||
run: |
|
||||
echo "CARGO=cargo" >> $GITHUB_ENV
|
||||
|
||||
- name: Install Cross
|
||||
if: ${{ matrix.use-cross == true }}
|
||||
shell: bash
|
||||
|
@ -71,10 +77,11 @@ jobs:
|
|||
curl -LO "https://github.com/cross-rs/cross/releases/download/v0.2.5/cross-x86_64-unknown-linux-musl.tar.gz"
|
||||
tar xf cross-x86_64-unknown-linux-musl.tar.gz
|
||||
echo "CARGO=cross" >> $GITHUB_ENV
|
||||
echo "RUSTFLAGS='--cfg sd_cross_compile'"
|
||||
echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
|
||||
echo "RUSTFLAGS=--cfg sd_cross_compile" >> $GITHUB_ENV
|
||||
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Test
|
||||
shell: bash
|
||||
run: |
|
||||
cargo test
|
||||
$CARGO --version
|
||||
$CARGO test --target ${{ matrix.target }}
|
||||
|
|
Loading…
Reference in a new issue