generated from EmbarkStudios/opensource-template
-
Notifications
You must be signed in to change notification settings - Fork 75
99 lines (89 loc) · 3.51 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Replace this line with the commented one to actually run the action in your repo(s)
on:
push:
branches:
- main
tags:
- "*"
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
name: CI
env:
RUSTFLAGS: -D warnings
RUSTDOCFLAGS: -D warnings
jobs:
lint:
name: Lint
runs-on: ubuntu-20.04-16core
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
targets: wasm32-unknown-unknown
- name: Install packages (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get -yq --no-install-suggests --no-install-recommends install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libasound2-dev libxkbcommon-dev # egui_glium dependencies
sudo apt-get install libgtk-3-dev # rfd dependencies
# make sure all code has been formatted with rustfmt
- name: rustfmt
run: cargo fmt -- --check --color always
- run: cargo fetch
- name: cargo clippy
run: cargo clippy --all-targets -- -D warnings
- name: cargo clippy wasm32-unknown-unknown WITHOUT web feature
run: cargo clippy -p puffin --target wasm32-unknown-unknown --no-default-features -- -D warnings
- name: cargo clippy wasm32
run: cargo clippy -p puffin_viewer --target wasm32-unknown-unknown --all-features --lib
test:
name: Test
strategy:
matrix:
os: [ubuntu-20.04-16core, windows-2022-16core, macOS-latest-xl]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo fetch
- name: Install packages (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get -yq --no-install-suggests --no-install-recommends install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libasound2-dev libxkbcommon-dev # egui_glium dependencies
sudo apt-get install libgtk-3-dev # rfd dependencies
- name: cargo test build default features
run: cargo build --tests --release
- name: cargo test build
run: cargo build --tests --release --all-features
- name: cargo test
run: cargo test -p puffin -p puffin_egui -p puffin_http --release --all-features
- name: cargo test --doc
run: cargo test --workspace --doc
- name: cargo doc
run: cargo doc -p puffin -p puffin_egui -p puffin_http -p --lib --no-deps --all-features
cargo-vet:
name: Vet Dependencies
runs-on: ubuntu-20.04-16core
env:
CARGO_VET_VERSION: 0.9.1
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: actions/cache@v3
with:
path: ${{ runner.tool_cache }}/cargo-vet
key: cargo-vet-bin-${{ env.CARGO_VET_VERSION }}
- name: Add the tool cache directory to the search path
run: echo "${{ runner.tool_cache }}/cargo-vet/bin" >> $GITHUB_PATH
- name: Ensure that the tool cache is populated with the cargo-vet binary
# build from source, as are not published binaries yet :(
# tracked in https://github.com/mozilla/cargo-vet/issues/484
run: cargo install --root ${{ runner.tool_cache }}/cargo-vet --version ${{ env.CARGO_VET_VERSION }} cargo-vet
- name: Invoke cargo-vet
run: |
cargo vet --locked
cargo vet --locked >> $GITHUB_STEP_SUMMARY