-
Notifications
You must be signed in to change notification settings - Fork 20
79 lines (74 loc) · 2.12 KB
/
ci.yaml
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
on: [push, pull_request]
name: CI
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs:
build_and_test:
name: Build and test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install libcamera
run: |
sudo pip3 install meson
sudo apt-get -y install libyaml-dev python3-yaml python3-ply python3-jinja2 ninja-build clang
git clone https://git.libcamera.org/libcamera/libcamera.git deps/libcamera --branch v0.1.0
cd deps/libcamera
# Use only VIMC for faster builds
meson build -Dipas=vimc -Dpipelines=vimc
sudo ninja -C build install
- name: Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Build
run: cargo build
- name: Test
run: cargo test
- name: Clippy
run: cargo clippy -- -D warnings
- name: Generate docs
env:
RUSTDOCFLAGS: "-Dwarnings"
run: cargo doc --no-deps --lib
- name: Upload docs artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: docs
path: target/doc
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- run: cargo fmt --all --check
docs:
name: Publish docs
runs-on: ubuntu-latest
needs: [build_and_test, rustfmt]
environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/download-artifact@v3
with:
name: docs
path: .
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: .
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1