2020-02-18 11:53:23 +01:00
|
|
|
name: Build
|
2020-01-05 00:04:20 +01:00
|
|
|
|
|
|
|
on: [push]
|
|
|
|
|
|
|
|
jobs:
|
2020-01-31 13:20:37 +01:00
|
|
|
all:
|
2020-01-31 15:29:01 +01:00
|
|
|
name: All
|
2020-01-05 05:05:24 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os:
|
|
|
|
- macos-latest
|
|
|
|
- ubuntu-latest
|
|
|
|
- windows-latest
|
2020-01-28 11:59:45 +01: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-05 05:05:24 +01:00
|
|
|
runs-on: ${{matrix.os}}
|
2020-01-05 00:04:20 +01:00
|
|
|
steps:
|
2020-01-31 13:20:37 +01:00
|
|
|
- uses: actions/checkout@v2
|
2020-01-05 05:05:24 +01:00
|
|
|
- name: Install
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
2020-01-28 11:59:45 +01:00
|
|
|
target: ${{matrix.target}}
|
2020-01-05 05:05:24 +01:00
|
|
|
profile: minimal
|
2020-01-05 05:24:32 +01:00
|
|
|
components: clippy, rustfmt
|
2020-01-05 05:05:24 +01:00
|
|
|
override: true
|
2020-01-05 03:58:42 +01:00
|
|
|
- name: Version
|
|
|
|
run: |
|
|
|
|
rustup --version
|
|
|
|
cargo --version
|
|
|
|
cargo clippy --version
|
2020-01-05 00:04:20 +01:00
|
|
|
- name: Build
|
2020-01-21 06:41:39 +01:00
|
|
|
run: cargo build --all --verbose
|
2020-01-05 00:04:20 +01:00
|
|
|
- name: Test
|
2020-01-21 06:41:39 +01:00
|
|
|
run: cargo test --all --verbose
|
2020-01-16 08:37:12 +01:00
|
|
|
- name: Clippy
|
2020-01-21 06:41:39 +01:00
|
|
|
run: cargo clippy --all
|
2020-01-16 08:37:12 +01:00
|
|
|
- name: Lint
|
|
|
|
if: matrix.os != 'windows-latest'
|
2020-01-31 10:54:46 +01:00
|
|
|
run: ./bin/lint
|
2020-01-28 11:59:45 +01:00
|
|
|
- name: Format
|
|
|
|
run: cargo fmt --all -- --check
|
2020-01-21 06:41:39 +01:00
|
|
|
- name: Readme
|
|
|
|
if: matrix.os != 'windows-latest'
|
|
|
|
run: |
|
|
|
|
cargo run --package update-readme toc
|
|
|
|
git diff --no-ext-diff --quiet --exit-code
|
2020-01-28 11:59:45 +01: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}}
|