-
Notifications
You must be signed in to change notification settings - Fork 16
51 lines (41 loc) · 1.76 KB
/
lint-on-push.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
name: check-linting
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on: [push, pull_request ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains the linting for python module
python-build-n-lint:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.10.6' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Create Virtual Environment
run: python -m venv ENV-dev
- name: Use VENV
run: source ENV-dev/bin/activate
- name: install packages
working-directory: ./py-usfm-parser
run: pip install -r dev-requirements.txt
- name: Setup node and npm
uses: actions/setup-node@v4
with:
node-version: 20
- name: Build grammar binary
working-directory: ./tree-sitter-usfm3
run: |
npm install --save nan
npm install --save-dev tree-sitter-cli
./node_modules/.bin/tree-sitter generate
- name: install tree-sitter-usfm3
working-directory: ./tree-sitter-usfm3
run: pip install .
- name: Run linter
working-directory: ./py-usfm-parser
run: pylint --extension-pkg-allow-list=lxml src/usfm_grammar/*.py