-
-
Notifications
You must be signed in to change notification settings - Fork 3
151 lines (134 loc) · 3.8 KB
/
Copy pathtest-crates.yml
File metadata and controls
151 lines (134 loc) · 3.8 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
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: test crates
on:
push:
branches:
- main
pull_request:
paths:
- ".github/workflows/**"
- "Cargo.lock"
- "Cargo.toml"
- "crates/**"
- "fixtures/**"
- "bin/**"
- "third_party/**"
- "rust-toolchain.toml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
fmt:
name: cargo fmt --check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.92.0
- name: Check formatting
run: cargo fmt --all -- --check
clippy:
name: cargo clippy
needs: [test]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Free up disk space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libexpat1-dev \
libfontconfig1-dev \
libfreetype6-dev \
libgl1-mesa-dev \
libgles2-mesa-dev \
libwayland-dev \
libx11-dev \
libx11-xcb-dev \
libxcb-render0-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
libxcursor-dev \
libxi-dev \
libxinerama-dev \
libxrandr-dev \
libxxf86vm-dev \
mesa-common-dev
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.92.0
components: clippy
- name: Cache cargo build outputs
uses: Swatinem/rust-cache@v2
with:
shared-key: test-native
cache-all-crates: true
cache-workspace-crates: true
cache-on-failure: true
- name: Run clippy
env:
FORCE_SKIA_BINARIES_DOWNLOAD: "1"
run: cargo clippy --no-deps --workspace --exclude grida-canvas-wasm -- -D warnings
test:
name: cargo test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
- name: Free up disk space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
df -h
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libexpat1-dev \
libfontconfig1-dev \
libfreetype6-dev \
libgl1-mesa-dev \
libgles2-mesa-dev \
libwayland-dev \
libx11-dev \
libx11-xcb-dev \
libxcb-render0-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
libxcursor-dev \
libxi-dev \
libxinerama-dev \
libxrandr-dev \
libxxf86vm-dev \
mesa-common-dev
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.92.0
- name: Cache cargo build outputs
uses: Swatinem/rust-cache@v2
with:
shared-key: test-native
cache-all-crates: true
cache-workspace-crates: true
cache-on-failure: true
- name: Run cargo tests
env:
FORCE_SKIA_BINARIES_DOWNLOAD: "1"
run: cargo test --workspace --exclude grida-canvas-wasm