panorama/.github/workflows/ci.yml
2021-03-27 02:22:02 -05:00

82 lines
1.7 KiB
YAML

on:
push:
branches:
- master
name: workflow
jobs:
workflow:
runs-on: ubuntu-latest
steps:
# Setup
- name: checkout
uses: actions/checkout@v2
- name: rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
# Retrieve the cache if there is one
- uses: actions/cache@v2
id: cache
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
# Install shit
- name: mdbook
uses: peaceiris/actions-mdbook@v1
if: steps.cache.outputs.cache-hit != 'true'
with:
mdbook-version: 'latest'
- name: install-cargo-deb
if: steps.cache.outputs.cache-hit != 'true'
run: |
cargo install mdbook --version 0.4.7
cargo install cargo-deb --version 1.29.1
# Run tests
- name: run tests
run: |
cargo test --all
# Generate documentation
- name: build mdbook
run: |
mdbook build docs -d $(pwd)/public
- name: build api docs
run: |
cargo doc --workspace --no-deps --document-private-items
cp -r target/doc public/api
- name: deploy
uses: JamesIves/github-pages-deploy-action@4.0.0
with:
branch: gh-pages
folder: public
# Build debian package
- name: build-deb
run: |
cargo deb
- uses: actions/upload-artifact@v2
with:
name: panorama.deb
path: target/debian/panorama*.deb
# vim: set sw=2 et :