gfaas 0.3.0

Distribute heavy-workload functions on Golem Network or other backend
name: Continuous Integration

on:
  push:
    branches:
      - master
  pull_request:

jobs:
  fmt:
    name: Rustfmt
    runs-on: macOS-latest
    steps:
    - uses: actions/checkout@v1
    - uses: actions-rs/toolchain@v1
      with:
        profile: minimal
        toolchain: stable
        override: true
        components: rustfmt
    - uses: actions-rs/cargo@v1
      with:
        command: fmt
        args: --all -- --check

  build:
    name: Build
    runs-on: ${{ matrix.os }}-latest
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu, macOS, windows]

    steps:
    - name: Checkout
      uses: actions/checkout@v1
    - name: Install Rust
      uses: actions-rs/toolchain@v1
      with:
        profile: minimal
        toolchain: stable
        override: true
    - uses: actions-rs/cargo@v1
      with:
        command: build
        args: --all --release

  test:
    name: Test
    runs-on: ${{ matrix.os }}-latest
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu, macOS, windows]

    steps:
    - uses: actions/checkout@v1
    - uses: actions-rs/toolchain@v1
      with:
        profile: minimal
        toolchain: stable
        override: true
    - uses: actions-rs/cargo@v1
      with:
        command: test
        args: --all

  docs:
    name: Docs
    needs: [build]
    runs-on: macOS-latest

    steps:
    - uses: actions/checkout@v1
    - uses: actions-rs/toolchain@v1
      with:
        profile: minimal
        toolchain: stable
        override: true
        components: rust-src
    - uses: actions-rs/cargo@v1
      with:
        command: doc
        args: --package gfaas --no-deps
    - uses: peaceiris/actions-gh-pages@v3
      if: github.event_name == 'push' && github.ref == 'refs/heads/master'
      with:
        github_token: ${{ secrets.GITHUB_TOKEN }}
        publish_dir: ./target/doc
        publish_branch: gh-pages