mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-07 03:55:28 +00:00
Merge 900577402ca2d77490bc7a8198f38e9587238a77 into 362418364fe8c0c2ec9f1284a9b35f26e4a1f69b
This commit is contained in:
commit
d01c078f3c
73
.github/workflows/build-and-test.yml
vendored
73
.github/workflows/build-and-test.yml
vendored
@ -12,8 +12,6 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
name: build
|
name: build
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
env:
|
|
||||||
CARGO: cargo
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@ -30,9 +28,6 @@ jobs:
|
|||||||
- aarch64-unknown-linux-musl
|
- aarch64-unknown-linux-musl
|
||||||
- armv7-unknown-linux-gnueabihf
|
- armv7-unknown-linux-gnueabihf
|
||||||
- armv7-unknown-linux-musleabihf
|
- armv7-unknown-linux-musleabihf
|
||||||
feature-use-zlib: [true, false]
|
|
||||||
feature-use-zstd-thin: [true, false]
|
|
||||||
feature-unrar: [true, false]
|
|
||||||
|
|
||||||
include:
|
include:
|
||||||
# default runner
|
# default runner
|
||||||
@ -62,66 +57,46 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install cross
|
|
||||||
if: matrix.use-cross
|
|
||||||
run: |
|
|
||||||
pushd "$(mktemp -d)"
|
|
||||||
wget https://github.com/cross-rs/cross/releases/download/v0.2.4/cross-x86_64-unknown-linux-musl.tar.gz
|
|
||||||
tar xf cross-x86_64-unknown-linux-musl.tar.gz
|
|
||||||
cp cross ~/.cargo/bin
|
|
||||||
popd
|
|
||||||
echo CARGO=cross >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Concatenate features
|
|
||||||
id: concat-features
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
FEATURES=()
|
|
||||||
if [[ ${{ matrix.feature-use-zlib }} == true ]]; then FEATURES+=(use_zlib); fi
|
|
||||||
if [[ ${{ matrix.feature-use-zstd-thin }} == true ]]; then FEATURES+=(use_zstd_thin); fi
|
|
||||||
if [[ ${{ matrix.feature-unrar }} == true ]]; then FEATURES+=(unrar); fi
|
|
||||||
IFS=','
|
|
||||||
echo "FEATURES=${FEATURES[*]}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Set up extra cargo flags
|
|
||||||
env:
|
|
||||||
FEATURES: ${{steps.concat-features.outputs.FEATURES}}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
FLAGS="--no-default-features"
|
|
||||||
if [[ -n "$FEATURES" ]]; then FLAGS+=" --features $FEATURES"; fi
|
|
||||||
echo "EXTRA_CARGO_FLAGS=$FLAGS" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
run: |
|
run: |
|
||||||
rustup toolchain install stable nightly --profile minimal -t ${{ matrix.target }}
|
rustup toolchain install stable nightly --profile minimal -t ${{ matrix.target }}
|
||||||
|
|
||||||
|
- name: Install cargo-hack
|
||||||
|
uses: taiki-e/install-action@cargo-hack
|
||||||
|
|
||||||
|
- name: Install cross
|
||||||
|
if: matrix.use-cross
|
||||||
|
uses: taiki-e/install-action@cross
|
||||||
|
|
||||||
|
- name: Configure cargo-hack to use cross
|
||||||
|
if: matrix.use-cross
|
||||||
|
run: |
|
||||||
|
echo "CARGO_HACK_CARGO_SRC=cross" >> $GITHUB_ENV
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
key: "${{ matrix.target }}-${{ matrix.feature-unrar }}-${{ matrix.feature-use-zstd-thin }}-${{ matrix.feature-unrar }}"
|
key: "${{ matrix.target }}"
|
||||||
|
|
||||||
- name: Test on stable
|
- name: Test on stable
|
||||||
# there's no way to run tests for ARM64 Windows for now
|
# there's no way to run tests for ARM64 Windows for now
|
||||||
if: matrix.target != 'aarch64-pc-windows-msvc'
|
if: matrix.target != 'aarch64-pc-windows-msvc'
|
||||||
run: |
|
run: |
|
||||||
${{ env.CARGO }} +stable test --target ${{ matrix.target }} $EXTRA_CARGO_FLAGS
|
cargo +stable hack test --target ${{ matrix.target }} --feature-powerset --optional-deps unrar
|
||||||
|
|
||||||
- name: Release on nightly
|
- name: Release on nightly
|
||||||
run: |
|
|
||||||
${{ env.CARGO }} +nightly build --release --target ${{ matrix.target }} $EXTRA_CARGO_FLAGS
|
|
||||||
env:
|
env:
|
||||||
OUCH_ARTIFACTS_FOLDER: artifacts
|
OUCH_ARTIFACTS_FOLDER: artifacts
|
||||||
RUSTFLAGS: -C strip=symbols
|
run: |
|
||||||
|
cargo +nightly hack build --release --target ${{ matrix.target }}
|
||||||
- name: Upload artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ouch-${{ matrix.target }}-${{ steps.concat-features.outputs.FEATURES }}
|
|
||||||
path: |
|
|
||||||
target/${{ matrix.target }}/release/ouch
|
|
||||||
target/${{ matrix.target }}/release/ouch.exe
|
|
||||||
artifacts/
|
|
||||||
|
|
||||||
|
# - name: Upload artifacts
|
||||||
|
# uses: actions/upload-artifact@v4
|
||||||
|
# with:
|
||||||
|
# name: ouch-${{ matrix.target }}-${{ steps.concat-features.outputs.FEATURES }}
|
||||||
|
# path: |
|
||||||
|
# target/${{ matrix.target }}/release/ouch
|
||||||
|
# target/${{ matrix.target }}/release/ouch.exe
|
||||||
|
# artifacts/
|
||||||
|
|
||||||
clippy-rustfmt:
|
clippy-rustfmt:
|
||||||
name: clippy-rustfmt
|
name: clippy-rustfmt
|
||||||
|
Loading…
x
Reference in New Issue
Block a user