-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (60 loc) · 2.14 KB
/
lint.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
name: Lint if snapshots change
on:
workflow_dispatch:
push:
branches:
- "**"
paths:
- ".github/workflows/lint.yaml"
- "test/aidbox_sdk/snapshots/**"
- "resources/sdk/**"
jobs:
mark-changed-files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set environment variables for changed files
id: set-env
run: |
CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})
echo "Changed files: $CHANGED_FILES"
echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV
lint-typescript:
needs: mark-changed-files
if: contains(env.CHANGED_FILES, 'test/aidbox_sdk/snapshots/typescript') || contains(env.CHANGED_FILES, 'resources/sdk/typescript')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Merge TypeScript SDK files
run: |
cp -r -u resources/sdk/typescript/* test/aidbox_sdk/snapshots/typescript/
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache-dependency-path: test/aidbox_sdk/snapshots/typescript/package-lock.json
- name: Install system and client dependencies
run: |
sudo apt -y update
cd test/aidbox_sdk/snapshots/typescript && npm ci
- name: Run ESLint
run: cd test/aidbox_sdk/snapshots/typescript && npm run lint
lint-python:
needs: mark-changed-files
if: contains(env.CHANGED_FILES, 'test/aidbox_sdk/snapshots/python') || contains(env.CHANGED_FILES, 'resources/sdk/python')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Merge Python SDK files
run: |
cp -r -u resources/sdk/python/* test/aidbox_sdk/snapshots/python/
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install system and client dependencies
run: |
cd test/aidbox_sdk/snapshots/python && pip install './[dev]'
- name: Run python lint
run: cd test/aidbox_sdk/snapshots/python && pylint **/*.py