name: Continuous Integration
on:
push:
branches:
- master
pull_request:
jobs:
build_stable_nix:
name: Build stable *nix
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu, macOS]
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Build release
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --release
build_stable_win:
name: Build stable Windows
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Install openssl
run: |
vcpkg search openssl
vcpkg install openssl:x64-windows
vcpkg list
- name: Build release
env:
VCPKGRS_DYNAMIC: ${{ 1 }}
run: |
vcpkg integrate install
cargo build --release
- name: Run tests
env:
VCPKGRS_DYNAMIC: ${{ 1 }}
run: |
vcpkg integrate install
cargo test --release
build_nightly:
name: Build beta & nightly
runs-on: macOS-latest
strategy:
fail-fast: false
matrix:
rust: [beta, nightly]
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Build debug
continue-on-error: true
uses: actions-rs/cargo@v1
with:
command: build
book:
name: Book docs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install mdbook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: '0.3.5'
- run: cd doc && mdbook build
- name: Push to gh-pages
uses: peaceiris/actions-gh-pages@v2
env:
PERSONAL_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./doc/book
if: github.event_name == 'push' && github.event.ref == 'refs/heads/master'