-
Notifications
You must be signed in to change notification settings - Fork 18
80 lines (64 loc) · 2.03 KB
/
main.yaml
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
name: Run grit patterns test
env:
GRIT_TELEMETRY_DISABLED: 'true'
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
build:
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
runner: [nscloud-ubuntu-22.04-amd64-4x16, macos-latest]
node-version: [20.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: setup auth
run: ./ops/set_access_token.sh
env:
API_CLIENT_ID: ${{ secrets.API_CLIENT_ID }}
API_CLIENT_SECRET: ${{ secrets.API_CLIENT_SECRET }}
- name: Install prettier
run: |
curl -L https://github.com/prettier/prettier/releases/download/3.0.1/prettier -o prettier
chmod +x prettier
sudo mv prettier /usr/local/bin
- name: install-ruff
run: |
pip install ruff
- name: Setup Go environment
uses: actions/[email protected]
with:
go-version: '^1.22.0'
- name: Install @getgrit/launcher
run: npm install -g @getgrit/launcher
- name: Run doctor
run: grit doctor
# grit check excludes all files under .grit, so we manually run this instead of using a check workflow
- name: Validate markdown names
run: |
cd .grit/patterns
output=$(grit apply grit_snake_case 2>&1)
echo "OUTPUT is:"
echo "$output"
if echo "$output" | grep -q 'found 0 matches'; then
echo "all file names valid"; else exit 1
fi
- name: Remove grit modules
run: rm -rf .grit/.gritmodules
- name: Run grit patterns test
run: |
if [ -n "${{ secrets.API_CLIENT_ID }}" ] && [ -n "${{ secrets.API_CLIENT_SECRET }}" ]; then
grit patterns test --exclude ai
else
grit patterns test --exclude ai
fi