summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCosmicHorror <CosmicHorrorDev@pm.me>2023-10-21 20:06:52 -0600
committerGitHub <noreply@github.com>2023-10-21 21:06:52 -0500
commit20b1459a4225982a56fd0fc57df6e5d10f4f568b (patch)
tree568eb47819395243f55a71330a31f8d4a8c95c77
parent4a544338609ea86fd8a0ef0755593ed148e9621b (diff)
Actually use the build target intended for each CI job (#252)
-rw-r--r--.github/workflows/publish.yml16
-rw-r--r--.github/workflows/test.yml13
2 files changed, 22 insertions, 7 deletions
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 22fd023..2a34b47 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -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
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 8c4cc96..3ce9afe 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -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 }}