-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into command_list
- Loading branch information
Showing
17 changed files
with
398 additions
and
594 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: build-and-test | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
name: build | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
- target: x86_64-apple-darwin | ||
os: macos-latest | ||
# - target: x86_64-pc-windows-gnu | ||
# os: windows-latest | ||
# ext: .exe | ||
- target: x86_64-pc-windows-msvc | ||
os: windows-latest | ||
ext: .exe | ||
- target: x86_64-unknown-linux-gnu | ||
os: ubuntu-latest | ||
- target: x86_64-unknown-linux-musl | ||
os: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies (musl) | ||
if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install help2man musl-tools | ||
- name: Build and test on stable | ||
run: | | ||
rustup toolchain install stable --profile minimal -t ${{ matrix.target }} | ||
cargo +stable build --target ${{ matrix.target }} | ||
cargo +stable test --target ${{ matrix.target }} | ||
- name: Release on nightly | ||
run: | | ||
rustup toolchain install nightly --profile minimal -t ${{ matrix.target }} | ||
cargo +nightly build --release --target ${{ matrix.target }} | ||
env: | ||
GEN_COMPLETIONS: 1 | ||
RUSTFLAGS: -Z strip=symbols | ||
|
||
- name: Upload bianry | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ouch-${{ matrix.target }}${{ matrix.ext }} | ||
path: target/${{ matrix.target }}/release/ouch${{ matrix.ext }} | ||
|
||
- name: Build man page and find completions (musl) | ||
if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} | ||
run: | | ||
help2man target/${{ matrix.target }}/release/ouch > ouch.1 | ||
cp -r target/${{ matrix.target }}/release/build/ouch-*/out/completions . | ||
- name: Upload completions (musl) | ||
if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: completions | ||
path: completions | ||
|
||
- name: Upload man page (musl) | ||
if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ouch.1 | ||
path: ouch.1 | ||
|
||
clippy-rustfmt: | ||
name: clippy-rustfmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: "Cargo: clippy, fmt" | ||
run: | | ||
rustup toolchain install stable --profile minimal -c clippy | ||
rustup toolchain install nightly --profile minimal -c rustfmt | ||
cargo +stable clippy -- -D warnings | ||
cargo +nightly fmt -- --check |
Oops, something went wrong.