-
Notifications
You must be signed in to change notification settings - Fork 3
58 lines (52 loc) · 1.66 KB
/
code-style.yaml
File metadata and controls
58 lines (52 loc) · 1.66 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
name: 'Code style'
on:
pull_request:
types:
- opened
- edited
- reopened
- synchronize
- labeled
merge_group:
types: [checks_requested]
branches:
- main
push:
branches:
- main
# For external contributions, the suggested flow is as follows:
# 1. Contributor creates a fork and enables GH Actions on it
# 2. Contributor develops in a fork, and pushes the changes to a branch named with prefix `dev-gh-`.
# The push triggers the tests on the contributor's fork on a Github Runner
# 3. Once the code in a branch is ready and passes the tests, the contributor creates a PR on the main repo.
- 'dev-gh-*'
env:
# When getting Rust dependencies, retry on network error:
CARGO_NET_RETRY: 10
# Use the local .curlrc
CURL_HOME: .
jobs:
rust:
name: 'consistent-style:required'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: 'Format code'
run: cargo fmt --all -- --check
env:
RUST_BACKTRACE: 1
- name: 'Lint code'
run: cargo clippy --verbose --tests --benches --workspace -- -D clippy::all
env:
RUST_BACKTRACE: 1
motoko_code_style:
name: 'motoko-code-style:required'
runs-on: ubuntu-latest
steps:
- name: 'Checkout code'
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Setup PNPM
uses: dfinity/ci-tools/actions/setup-pnpm@afeee4fbdc0683a88ec5a74ed7f59a2ce0e833ad # main
- name: 'Check code formatting'
run: pnpm format:check