-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (71 loc) · 2.3 KB
/
ci.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
name: Rust Check & Build
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master and tags branch
push:
tags:
- v*
branches:
- master
- main
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
# Not needed in CI, should make things a bit faster
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
# Build smaller artifacts to avoid running out of space in CI
RUSTFLAGS: -C strip=debuginfo
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
check_and_build:
name: Check and Build
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v3
- name: Set up
run: sudo apt-get update -y && sudo apt install -y git clang curl libssl-dev llvm libudev-dev
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
# TODO: Below can be removed when https://github.com/actions-rs/toolchain/issues/126 is resolved
with:
toolchain: nightly
target: wasm32-unknown-unknown
profile: minimal
components: rustfmt,clippy
override: true
- name: Configure cache
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: cargo fmt --all -- --check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: cargo clippy --all
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all -- -D warnings
- name: cargo test
uses: actions-rs/cargo@v1
with:
command: test
- name: cargo check --release
uses: actions-rs/cargo@v1
with:
command: check
args: --release