-
Notifications
You must be signed in to change notification settings - Fork 7
81 lines (65 loc) · 2.33 KB
/
_lint-external.yml
File metadata and controls
81 lines (65 loc) · 2.33 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
name: Linting (External)
on:
workflow_call:
permissions:
contents: read
issues: write
jobs:
source:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [24.x]
steps:
- uses: actions/checkout@v6.0.2
with:
ref: ${{ github.head_ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6.3.0
with:
node-version: ${{ matrix.node-version }}
- name: Setup pnpm
uses: pnpm/action-setup@v4.3.0
with:
version: latest
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Cache pnpm modules
uses: actions/cache@v5.0.3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Install dependencies
run: pnpm install
- name: Sort
run: pnpm run sort:dry
- name: Lint
run: pnpm run lint:dry
- name: Prettier
run: pnpm run prettier:dry
- name: Forge Format
working-directory: contracts
run: |
forge fmt --check
- name: Print linting instructions on failure
if: failure()
run: |
echo "🚨 Linting/Formatting issues were detected."
echo ""
echo "Please run the following commands locally to fix them:"
echo ""
echo " pnpm run sort"
echo " pnpm run lint"
echo " pnpm run prettier"
echo " cd contracts && forge fmt"
echo ""
echo "Then update your PR. 🚀"