2020-02-18 11:53:23 +01:00
|
|
|
name: Build
|
2020-01-05 00:04:20 +01:00
|
|
|
|
2020-03-07 03:39:17 +01:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2020-03-18 15:45:27 +01:00
|
|
|
tags:
|
|
|
|
- v*.*.*
|
2020-03-07 03:39:17 +01:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
2020-01-05 00:04:20 +01:00
|
|
|
|
|
|
|
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-03-20 04:19:52 +01:00
|
|
|
env:
|
|
|
|
RUSTFLAGS: "-D warnings"
|
2020-01-05 00:04:20 +01:00
|
|
|
steps:
|
2020-01-31 13:20:37 +01:00
|
|
|
- uses: actions/checkout@v2
|
2020-03-06 07:51:00 +01:00
|
|
|
- name: Install Stable
|
2020-01-05 05:05:24 +01:00
|
|
|
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-03-20 04:19:52 +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-03-06 07:51:00 +01:00
|
|
|
- name: Install Nightly
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: nightly
|
|
|
|
target: ${{matrix.target}}
|
|
|
|
profile: minimal
|
|
|
|
components: rustfmt
|
2020-01-28 11:59:45 +01:00
|
|
|
- name: Format
|
2020-03-06 07:51:00 +01:00
|
|
|
run: cargo +nightly fmt --all -- --check
|
2020-03-28 06:46:41 +01:00
|
|
|
- name: Completion Scripts
|
|
|
|
if: matrix.os != 'windows-latest'
|
|
|
|
run: |
|
|
|
|
./bin/generate-completions
|
|
|
|
git diff --no-ext-diff --quiet --exit-code
|
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-03-20 04:19:52 +01:00
|
|
|
- name: Install `mdbook`
|
|
|
|
uses: peaceiris/actions-mdbook@v1
|
|
|
|
with:
|
|
|
|
mdbook-version: latest
|
|
|
|
- name: Build Book
|
|
|
|
run: mdbook build book --dest-dir ../www/book
|
2020-03-20 04:42:38 +01:00
|
|
|
- name: Record Git Revision
|
2020-03-21 23:11:57 +01:00
|
|
|
if: github.ref == 'refs/heads/master' && matrix.os == 'ubuntu-latest'
|
2020-03-20 15:07:32 +01:00
|
|
|
run: git rev-parse --verify HEAD > www/head.txt
|
2020-03-20 04:42:38 +01:00
|
|
|
- name: Deploy Pages
|
2020-03-20 04:19:52 +01:00
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
2020-03-21 23:11:57 +01:00
|
|
|
if: github.ref == 'refs/heads/master' && matrix.os == 'ubuntu-latest'
|
2020-03-20 04:19:52 +01:00
|
|
|
with:
|
2020-03-20 04:42:38 +01:00
|
|
|
github_token: ${{secrets.GITHUB_TOKEN}}
|
2020-03-20 04:19:52 +01:00
|
|
|
publish_branch: gh-pages
|
2020-03-20 04:42:38 +01:00
|
|
|
publish_dir: ./www
|
2020-01-28 11:59:45 +01:00
|
|
|
- name: Package
|
|
|
|
id: package
|
|
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
|
|
shell: bash
|
2020-03-20 04:19:52 +01:00
|
|
|
run: ./bin/package ${{github.ref}} ${{matrix.os}} ${{matrix.target}}
|
2020-01-28 11:59:45 +01:00
|
|
|
- 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}}
|