Skip to content

Commit 7e099a6

Browse files
authored
ci: add lint workflow (#1)
* ci: add lint workflow * ci: add lint workflow
1 parent a748465 commit 7e099a6

1 file changed

Lines changed: 75 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
name: CI
3+
4+
on:
5+
pull_request:
6+
branches: [main]
7+
push:
8+
branches: [main]
9+
workflow_dispatch:
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
lint:
20+
name: Lint
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 15
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
27+
28+
- name: Install uv
29+
uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 # v7.2.1
30+
31+
- name: Install Biome
32+
run: |
33+
npm install -g @biomejs/biome@2.3.2
34+
35+
- name: Install just
36+
run: |
37+
JUST_VERSION="1.46.0"
38+
JUST_BASE="https://github.com/casey/just/releases/download"
39+
JUST_TAR="just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz"
40+
curl -fsSL "${JUST_BASE}/${JUST_VERSION}/${JUST_TAR}" | tar xz -C /tmp
41+
sudo mv /tmp/just /usr/local/bin/
42+
43+
- name: Install rumdl
44+
run: |
45+
RUMDL_VERSION="v0.1.26"
46+
RUMDL_BASE="https://github.com/rvben/rumdl/releases/download"
47+
RUMDL_TAR="rumdl-${RUMDL_VERSION}-x86_64-unknown-linux-gnu.tar.gz"
48+
curl -fsSL "${RUMDL_BASE}/${RUMDL_VERSION}/${RUMDL_TAR}" | tar xz
49+
sudo mv rumdl /usr/local/bin/
50+
51+
- name: Install linting tools
52+
run: |
53+
uv tool install yamllint
54+
uv tool install codespell
55+
56+
- name: Cache Vale styles
57+
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
58+
with:
59+
path: .vale
60+
key: vale-styles-${{ hashFiles('.vale.ini') }}
61+
restore-keys: |
62+
vale-styles-
63+
64+
- name: Install and sync Vale
65+
run: |
66+
uv tool install vale
67+
vale sync
68+
69+
- name: Run linters
70+
run: just lint
71+
72+
- name: Lint GitHub Actions workflows
73+
run: |
74+
bash <(curl -fsSL https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
75+
./actionlint -color

0 commit comments

Comments
 (0)