-
Notifications
You must be signed in to change notification settings - Fork 14
71 lines (66 loc) · 2.37 KB
/
codestyle.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
# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586837012/Code+style+testing
# Nested workflow for checks related to formatting Rust code
name: codestyle
# Triger: only call from main workflow(re-usable workflows)
on:
workflow_call:
jobs:
rustfmt:
runs-on: [ self-hosted-ci ]
steps:
- name: Clean Workspace
uses: AutoModality/[email protected]
- uses: actions/[email protected]
with:
ref: ${{ github.head_ref }}
- name: Read .env file
uses: xom9ikk/[email protected]
- name: Install toolchain version from .env
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
targets: wasm32-unknown-unknown
components: rustfmt, clippy
- name: Run cargo fmt
run: cargo fmt -- --check # In that mode it returns only exit code.
- name: Cargo fmt state
if: success()
run: echo "Nothing to do. Command 'cargo fmt -- --check' returned exit code 0."
yarn_eslint:
runs-on: [ self-hosted-ci ]
steps:
- name: Clean Workspace
uses: AutoModality/[email protected]
- uses: actions/[email protected]
with:
ref: ${{ github.head_ref }}
- uses: actions/[email protected]
with:
node-version: 20
- name: Install modules
run: cd js-packages && yarn
- name: Run ESLint
# run: cd js-packages && yarn lint --max-warnings=0
run: cd js-packages && yarn lint
clippy:
runs-on: [ self-hosted-ci ]
steps:
- name: Clean Workspace
uses: AutoModality/[email protected]
- uses: actions/[email protected]
with:
ref: ${{ github.head_ref }}
- name: Install substrate dependencies
run: sudo apt install -y libssl-dev pkg-config libclang-dev clang protobuf-compiler
- name: Read .env file
uses: xom9ikk/[email protected]
- name: Install toolchain version from .env
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
targets: wasm32-unknown-unknown
components: rustfmt, clippy
- name: Run cargo check
run: cargo clippy --features=quartz-runtime,unique-runtime,try-runtime,runtime-benchmarks --tests -- -Dwarnings
env:
SKIP_WASM_BUILD: '1'