Skip to content
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 46 additions & 15 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ on:

jobs:
build:
name: Docs build
name: Docs Build
runs-on: ubuntu-latest
steps:
- name: Checkout Source code
- name: Checkout Source Code
uses: actions/checkout@v5

- name: Use Node.js 22
Expand All @@ -21,7 +21,7 @@ jobs:
cache-dependency-path: 'package-lock.json'
always-auth: 'true'

- name: Enable corepack
- name: Enable Corepack
run: |
corepack enable

Expand All @@ -40,13 +40,13 @@ jobs:
sudo apt-get update
sudo apt-get install -y nginx

- name: Start Docusaurus server
- name: Start Docusaurus Server
run: |
nohup npx docusaurus serve --port 3000 --no-open &
sleep 5
curl -f http://localhost:3000 > /dev/null

- name: Start Nginx with project config
- name: Start Nginx with Project Config
run: |
cat > default.conf <<EOF
worker_processes auto;
Expand All @@ -63,7 +63,7 @@ jobs:
nginx -c $(pwd)/default.conf
sleep 1

- name: Run header assertions
- name: Run Header Assertions
run: |
set -euo pipefail
function assert_header() {
Expand Down Expand Up @@ -96,13 +96,13 @@ jobs:
run: nginx -c $(pwd)/default.conf -s stop

lint_content:
name: Lint markdown content
name: Lint Markdown Content
runs-on: ubuntu-latest
steps:
- name: Checkout Source code
- name: Checkout Source Code
uses: actions/checkout@v5

- name: Get changed files
- name: Get Changed Files
id: changed-files
uses: tj-actions/changed-files@v47
with:
Expand All @@ -117,7 +117,7 @@ jobs:
cache: 'npm'
cache-dependency-path: 'package-lock.json'

- name: Enable corepack
- name: Enable Corepack
run: |
corepack enable

Expand All @@ -136,11 +136,11 @@ jobs:
done


lint_code:
name: Lint app code
lint_code_js:
name: Lint JavaScript Code
runs-on: ubuntu-latest
steps:
- name: Checkout Source code
- name: Checkout Source Code
uses: actions/checkout@v5

- name: Use Node.js 22
Expand All @@ -150,7 +150,7 @@ jobs:
cache: 'npm'
cache-dependency-path: 'package-lock.json'

- name: Enable corepack
- name: Enable Corepack
run: |
corepack enable

Expand All @@ -159,4 +159,35 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- run: npm run lint:code
- run: npm run lint:code:js


lint_code_py:
name: Lint Python Code
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v5

- name: Get Changed Files
id: changed-files
uses: tj-actions/changed-files@v47
with:
files: '**/*.{md,mdx}'
files_ignore: '!sources/api/*.{md,mdx}'
separator: ","

- name: Get uv
uses: astral-sh/setup-uv@v7

- name: List and Lint Changed Files
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
IFS=',' read -ra FILE_ARRAY <<< "$ALL_CHANGED_FILES"
for file in "${FILE_ARRAY[@]}"; do
uv run --with doccmd --with ruff doccmd --language=py --language=python --command=\"ruff check --quiet\" "$file"
done

# TODO: once we fix existing issues, switch to checking the whole sources/ directory
# - run: npm run lint:code:py
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@
"lint:fix": "npm run lint:md:fix && npm run lint:code:fix",
"lint:md": "markdownlint '**/*.md'",
"lint:md:fix": "markdownlint '**/*.md' --fix",
"lint:code": "eslint .",
"lint:code:fix": "eslint . --fix",
"lint:code": "npm run lint:code:js && npm run lint:code:py",
"lint:code:fix": "npm run lint:code:js:fix",
"lint:code:js": "eslint .",
"lint:code:js:fix": "eslint . --fix",
"lint:code:py": "uv run --with doccmd --with ruff doccmd --language=py --command=\"ruff check --quiet\" ./sources",
"postinstall": "patch-package",
"postbuild": "node ./scripts/joinLlmsFiles.mjs && node ./scripts/indentLlmsFile.mjs"
},
Expand Down
Loading