-
-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (105 loc) · 3.36 KB
/
actions.yml
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
on: [push]
name: noentiendo CI
permissions:
contents: write
jobs:
desktop-build:
name: Desktop Build and Style Check
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install system libraries
run: sudo apt-get install libudev-dev
- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Check clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all -- -D warnings
- name: Build for desktop
uses: actions-rs/cargo@v1
with:
command: build
web-build:
name: WASM Build, Docs Build, and Web Deploy
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: "-D warnings"
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install system libraries
run: sudo apt-get install libudev-dev
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 16
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build WASM module
run: wasm-pack build
- name: Build Webpack app
run: |
cd www
npm install
npm run build
- name: Generate documentation
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps
- name: Copy files
run: |
mkdir pages
cp -r www/dist/* pages
cp -r target/doc pages
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
if: github.ref == 'refs/heads/main'
with:
folder: pages
tests-coverage:
name: Tests and Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install system libraries
run: sudo apt-get install libudev-dev
- name: Run tests and collect coverage
run: LLVM_PROFILE_FILE='cargo-test-%p-%m.profraw' RUSTFLAGS="-Cinstrument-coverage -Clink-dead-code" cargo test
- name: Install coverage tools (llvm-tools-preview)
run: rustup component add llvm-tools-preview
- name: Install coverage tools (grcov)
run: curl -L https://github.com/mozilla/grcov/releases/latest/download/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf -
- name: Generate coverage report
run: mkdir ./target/coverage/ && ./grcov . -s . --binary-path ./target/debug/ -t lcov --branch --ignore-not-existing -o ./target/coverage/lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./target/coverage/lcov.info
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}