-
Notifications
You must be signed in to change notification settings - Fork 4
73 lines (65 loc) · 1.96 KB
/
lint.yml
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 code
on: [push, pull_request]
jobs:
skip_check:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: 'same_content_newer'
skip_after_successful_duplicate: 'true'
ts_lint:
name: Lint TypeScript
runs-on: ubuntu-latest
needs: skip_check
if: needs.skip_check.outputs.should_skip != 'true'
steps:
- uses: actions/checkout@v3
- name: Cache node modules
uses: actions/cache@v3
with:
path: |
timApp/node_modules
timApp/modules/jsrunner/server/node_modules
key: ${{ runner.os }}-eslint-npm-${{ hashFiles('**/package-lock.json') }}
- name: Install packages
run: |
npm i --global npm@6
cd timApp
npm install
cd modules/jsrunner/server
npm install
- name: Lint main code
run: cd timApp && npm run lint
- name: Lint JSRunner
run: cd timApp/modules/jsrunner/server && npm run lint
py_lint:
name: Lint Python
runs-on: ubuntu-latest
env:
PYTHON_VERSION: "3.10"
needs: skip_check
if: needs.skip_check.outputs.should_skip != 'true'
steps:
- uses: actions/checkout@v3
- name: Install APT Packages
uses: awalsh128/[email protected]
with:
packages: libxmlsec1-dev libxmlsec1-openssl
version: "1.1"
- name: Install Poetry
run: pipx install poetry
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: "${{ env.PYTHON_VERSION }}"
cache: poetry
- name: Install dependencies
run: |
poetry env use "${{ env.PYTHON_VERSION }}"
poetry install --only=dev
- name: Run MyPy
run: .venv/bin/mypy -p timApp -p tim_common