Skip to content

Commit

Permalink
Merge branch 'master' into command_list
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospb19 authored Nov 2, 2021
2 parents 8527616 + cd77b98 commit a95d975
Show file tree
Hide file tree
Showing 17 changed files with 398 additions and 594 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/build-and-test.yml
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
Loading

0 comments on commit a95d975

Please sign in to comment.