-
Notifications
You must be signed in to change notification settings - Fork 3
58 lines (50 loc) · 2.09 KB
/
rustfmt.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
name: rustfmt
on:
pull_request:
branches: [main]
paths:
- '**.rs'
- '.github/workflows/rustfmt.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
ENVIRONMENT: development
GH_TOKEN: ${{ github.token }}
jobs:
check:
runs-on: ubuntu-latest
steps:
# Checkout the repo
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install npm
run: npm i -g npm@$(cat package.json | jq -r .engines.npm)
- run: mkdir -p protocol/cargo-cache
- run: mkdir -p protocol/target
- run: mkdir -p node_modules
- run: mkdir -p ~/.cache/Cypress
- name: Restore cache
uses: actions/cache/restore@v3
with:
path: |
protocol/cargo-cache
protocol/target
node_modules
~/.cache/Cypress
# note that restoring a cache in github is a pain. The trailing '-' matches any string after the '-', therefore 'abc-' would match a cache named 'abc-1234' or 'abc-5678', etc.
# the problem is 'abc-' will not match a cache named 'abc'! So if you're using wildcard cache name selectors like this, you need a field that changes as the suffix to become the wildcard
# here we're setting the key to an unused cache key so it falls back to the wildcard selector in `restore-keys`
key: some-unused-cache-key
restore-keys: |
project-cache-${{ runner.os }}-${{ runner.arch }}-
- run: npm install
- run: npm run removePolkadotJSWarnings
- name: Rust formatting check
run: |
cd protocol/dev
npm run build
npm run cli -- fmt --all --verbose --check --docker