This repository was archived by the owner on Mar 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
82 lines (68 loc) · 2.14 KB
/
ci.yaml
File metadata and controls
82 lines (68 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: CI
on: [push, pull_request, workflow_dispatch]
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust toolchain (nightly)
id: install_rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
default: true
- name: Install SDL2
run: sudo apt-get install libsdl2-dev
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-rust-${{ steps.install_rust.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-rust-${{ steps.install_rust.outputs.rustc_hash }}-
- name: cargo check
run: cargo check --verbose --workspace --all-targets
- name: cargo build
run: cargo build --verbose
- name: cargo test
run: cargo test --verbose --workspace
- name: cargo fmt
run: cargo fmt --verbose --all -- --check
- name: cargo clippy
run: cargo clippy --verbose --workspace
upload_docs:
name: Upload documentation
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
- name: Install Rust toolchain (stable)
id: install_rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-rust-${{ steps.install_rust.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-rust-${{ steps.install_rust.outputs.rustc_hash }}-
- name: Generate documentation
run: ./docs.sh --verbose
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: target/doc
force_orphan: true