mirror of
https://github.com/lcdr/lu_packets.git
synced 2026-01-05 16:28:53 -06:00
76 lines
1.8 KiB
YAML
76 lines
1.8 KiB
YAML
on: push
|
|
|
|
name: Compile + Test + Update docs
|
|
|
|
jobs:
|
|
push:
|
|
name: Compile + Test + Update docs
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Cache toolchain
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.rustup/toolchains
|
|
~/.rustup/update-hashes
|
|
~/.rustup/settings.toml
|
|
key: toolchain-${{ hashFiles('rust-toolchain') }}
|
|
|
|
- name: Cache dependencies
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
key: deps-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
- name: Cache build
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
target/.rustc_info.json
|
|
target/debug
|
|
key: target-debug-${{ github.run_number }}
|
|
restore-keys: |
|
|
target-debug-
|
|
|
|
- name: Compile
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
args: --no-run
|
|
|
|
- name: Test
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
|
|
- name: Cache docs
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
target/doc
|
|
key: target-doc-${{ github.run_number }}
|
|
restore-keys: |
|
|
target-doc-
|
|
|
|
- name: Generate documentation
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: doc
|
|
args: --no-deps
|
|
|
|
- name: Create .nojekyll file
|
|
run: touch target/doc/.nojekyll
|
|
|
|
- name: Deploy to GitHub Pages
|
|
uses: JamesIves/github-pages-deploy-action@releases/v3
|
|
with:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
BRANCH: gh-pages
|
|
FOLDER: target/doc
|
|
SINGLE_COMMIT: true
|