2020-01-25 19:58:32 -08:00
|
|
|
name: Main
|
2020-01-15 02:16:13 -08:00
|
|
|
|
|
|
|
on: [push]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2020-01-25 19:58:32 -08:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os:
|
|
|
|
- macos-latest
|
|
|
|
- ubuntu-latest
|
|
|
|
- windows-latest
|
2020-01-28 02:19:24 -08:00
|
|
|
include:
|
|
|
|
- os: ubuntu-latest
|
|
|
|
target: x86_64-unknown-linux-musl
|
|
|
|
- os: macos-latest
|
|
|
|
target: x86_64-apple-darwin
|
|
|
|
- os: windows-latest
|
|
|
|
target: x86_64-pc-windows-msvc
|
2020-01-25 19:58:32 -08:00
|
|
|
runs-on: ${{matrix.os}}
|
2020-01-15 02:16:13 -08:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Install
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
2020-01-28 02:19:24 -08:00
|
|
|
target: ${{ matrix.target }}
|
2020-01-15 02:16:13 -08:00
|
|
|
profile: minimal
|
|
|
|
components: clippy, rustfmt
|
|
|
|
override: true
|
|
|
|
- name: Version
|
|
|
|
run: |
|
|
|
|
rustup --version
|
|
|
|
cargo --version
|
|
|
|
cargo clippy --version
|
2020-01-25 19:58:32 -08:00
|
|
|
- name: Build
|
|
|
|
run: cargo build --all --verbose
|
|
|
|
- name: Test
|
|
|
|
run: cargo test --all --verbose
|
2020-01-15 02:30:24 -08:00
|
|
|
- name: Clippy
|
2020-01-25 19:58:32 -08:00
|
|
|
run: cargo clippy --all
|
2020-01-15 02:30:24 -08:00
|
|
|
- name: Lint
|
2020-01-25 19:58:32 -08:00
|
|
|
if: matrix.os != 'windows-latest'
|
2020-01-15 02:30:24 -08:00
|
|
|
run: cargo run lint
|
2020-01-15 02:16:13 -08:00
|
|
|
- name: Format
|
2020-01-25 19:58:32 -08:00
|
|
|
run: cargo fmt --all -- --check
|
2020-01-15 02:16:13 -08:00
|
|
|
- name: Completion Scripts
|
2020-01-25 19:58:32 -08:00
|
|
|
if: matrix.os != 'windows-latest'
|
2020-01-15 02:16:13 -08:00
|
|
|
run: |
|
|
|
|
for script in completions/*; do
|
|
|
|
shell=${script##*.}
|
|
|
|
cargo run -- --completions $shell > $script
|
|
|
|
done
|
|
|
|
git diff --no-ext-diff --quiet --exit-code
|
2020-01-28 02:19:24 -08:00
|
|
|
- name: Package
|
|
|
|
id: package
|
|
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
|
|
run: ./bin/package ${{github.ref}} ${{matrix.os}} ${{ matrix.target }}
|
|
|
|
shell: bash
|
|
|
|
- name: Publish
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
|
|
with:
|
|
|
|
draft: false
|
|
|
|
files: ${{ steps.package.outputs.archive }}
|
|
|
|
prerelease: false
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|