-
Notifications
You must be signed in to change notification settings - Fork 11
116 lines (89 loc) · 3.06 KB
/
Copy pathformat.yml
File metadata and controls
116 lines (89 loc) · 3.06 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
name: "Run Format"
on:
push:
branches: [main]
pull_request:
branches: [main, "feature/**"]
permissions:
contents: read
jobs:
format-rust:
name: cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Retrieve Rust version
id: rust-version
run: echo "rust-version=$(grep '^rust ' .tool-versions | awk '{print $2}')" >> $GITHUB_OUTPUT
shell: bash
- name: Set up rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ steps.rust-version.outputs.rust-version }}
target: wasm32-wasip1,wasm32-unknown-unknown
components: "clippy, rustfmt"
cache-shared-key: cargo-${{ runner.os }}
- name: Run cargo fmt
uses: actions-rust-lang/rustfmt@v1
- name: Run cargo clippy (Fastly — wasm32-wasip1)
run: cargo clippy-fastly
- name: Run cargo clippy (Axum — native)
run: cargo clippy-axum
- name: Run cargo clippy (Cloudflare — native)
run: cargo clippy-cloudflare
- name: Run cargo clippy (Cloudflare — wasm32-unknown-unknown)
run: cargo clippy-cloudflare-wasm
- name: Run cargo clippy (Spin — native)
run: cargo clippy-spin-native
- name: Run cargo clippy (Spin — wasm32-wasip1)
run: cargo clippy-spin-wasm
- name: Run host-target CLI clippy
run: cargo clippy --package trusted-server-cli --target x86_64-unknown-linux-gnu --all-targets --all-features -- -D warnings
format-typescript:
runs-on: ubuntu-latest
defaults:
run:
working-directory: crates/trusted-server-js/lib
steps:
- uses: actions/checkout@v4
- name: Retrieve Node.js version
id: node-version
working-directory: .
run: echo "node-version=$(grep '^nodejs ' .tool-versions | awk '{print $2}')" >> $GITHUB_OUTPUT
shell: bash
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ steps.node-version.outputs.node-version }}
cache: "npm"
cache-dependency-path: crates/trusted-server-js/lib/package.json
- name: Install dependencies
run: npm ci
- name: Run ESLint
run: npm run lint
- name: Run Prettier (check)
run: npm run format
format-docs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
steps:
- uses: actions/checkout@v4
- name: Retrieve Node.js version
id: node-version
working-directory: .
run: echo "node-version=$(grep '^nodejs ' .tool-versions | awk '{print $2}')" >> $GITHUB_OUTPUT
shell: bash
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ steps.node-version.outputs.node-version }}
cache: "npm"
cache-dependency-path: docs/package.json
- name: Install dependencies
run: npm ci
- name: Run ESLint
run: npm run lint
- name: Run Prettier (check)
run: npm run format