3 on: [push, pull_request]
8 runs-on: ${{ matrix.os }}
14 - target: aarch64-unknown-linux-gnu
18 - target: aarch64-unknown-linux-musl
22 - target: armv7-unknown-linux-gnueabihf
26 - target: armv7-unknown-linux-musleabihf
30 - target: x86_64-apple-darwin
33 - target: x86_64-pc-windows-gnu
38 - target: x86_64-pc-windows-msvc
42 - target: x86_64-unknown-linux-gnu
45 - target: x86_64-unknown-linux-musl
50 uses: actions/checkout@v3
52 - name: Install cross (non-x86_64 linux)
53 if: "!contains(matrix.target, 'x86_64') && runner.os == 'Linux'"
56 wget https://github.com/cross-rs/cross/releases/download/v0.2.4/cross-x86_64-unknown-linux-musl.tar.gz
57 tar xf cross-x86_64-unknown-linux-musl.tar.gz
60 echo CARGO=cross >> $GITHUB_ENV
62 - name: Install dependencies (x86_64-unknown-linux-musl)
63 if: matrix.target == 'x86_64-unknown-linux-musl'
66 sudo apt-get install musl-tools
68 - name: Set up extra cargo flags
69 if: matrix.no-zstd-thin
71 echo "EXTRA_CARGO_FLAGS=--no-default-features --features flate2/zlib,zip/deflate-zlib" >> $GITHUB_ENV
75 rustup toolchain install stable nightly --profile minimal -t ${{ matrix.target }}
77 - name: Test on stable
79 ${{ env.CARGO }} +stable test --target ${{ matrix.target }} $EXTRA_CARGO_FLAGS
81 - name: Release on nightly
83 ${{ env.CARGO }} +nightly build --release --target ${{ matrix.target }} $EXTRA_CARGO_FLAGS
85 OUCH_ARTIFACTS_FOLDER: artifacts
86 RUSTFLAGS: -C strip=symbols
89 uses: actions/upload-artifact@v3
91 name: ouch-${{ matrix.target }}${{ matrix.ext }}
92 path: target/${{ matrix.target }}/release/ouch${{ matrix.ext }}
94 - name: Upload artifacts (musl)
95 if: matrix.target == 'x86_64-unknown-linux-musl'
96 uses: actions/upload-artifact@v3
103 runs-on: ubuntu-latest
106 uses: actions/checkout@v3
108 - name: "Cargo: clippy, fmt"
110 rustup toolchain install stable --profile minimal -c clippy
111 rustup toolchain install nightly --profile minimal -c rustfmt
112 cargo +stable clippy -- -D warnings
113 cargo +nightly fmt -- --check
117 runs-on: ubuntu-latest
118 if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
122 uses: actions/checkout@v3
124 - name: Download artifacts
125 uses: dawidd6/action-download-artifact@v2
129 - name: Package release assets
130 run: scripts/package-release-assets.sh
132 - name: Create release
133 uses: softprops/action-gh-release@v1
136 files: release/ouch-*