panorama/.github/workflows/ci.yml

83 lines
1.7 KiB
YAML
Raw Normal View History

on:
push:
branches:
- master
2021-02-16 10:52:42 +00:00
2021-03-25 09:35:31 +00:00
name: workflow
2021-02-16 10:52:42 +00:00
jobs:
2021-03-25 09:35:31 +00:00
workflow:
2021-02-16 10:52:42 +00:00
runs-on: ubuntu-latest
2021-03-25 09:35:31 +00:00
2021-02-16 10:52:42 +00:00
steps:
2021-03-25 09:35:31 +00:00
# Setup
2021-02-16 10:55:36 +00:00
- name: checkout
uses: actions/checkout@v2
- name: rust
uses: actions-rs/toolchain@v1
2021-02-16 10:52:42 +00:00
with:
toolchain: stable
2021-02-16 10:55:36 +00:00
2021-03-27 07:20:48 +00:00
# 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
2021-02-16 10:55:36 +00:00
- name: mdbook
uses: peaceiris/actions-mdbook@v1
2021-03-27 07:22:02 +00:00
if: steps.cache.outputs.cache-hit != 'true'
2021-02-16 10:55:36 +00:00
with:
mdbook-version: 'latest'
2021-03-27 07:20:48 +00:00
- name: install-cargo-deb
2021-03-27 07:22:02 +00:00
if: steps.cache.outputs.cache-hit != 'true'
2021-03-27 07:20:48 +00:00
run: |
cargo install mdbook --version 0.4.7
cargo install cargo-deb --version 1.29.1
2021-03-25 09:35:31 +00:00
# Run tests
- name: run tests
run: |
cargo test --all
# Generate documentation
2021-02-16 10:55:36 +00:00
- name: build mdbook
run: |
2021-02-16 10:52:42 +00:00
mdbook build docs -d $(pwd)/public
2021-02-16 10:55:36 +00:00
- name: build api docs
run: |
cargo doc --workspace --no-deps --document-private-items
2021-02-16 10:52:42 +00:00
cp -r target/doc public/api
2021-02-16 10:55:36 +00:00
2021-02-16 10:52:42 +00:00
- name: deploy
uses: JamesIves/github-pages-deploy-action@4.0.0
with:
branch: gh-pages
folder: public
2021-03-25 09:35:31 +00:00
# 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 :