-
Notifications
You must be signed in to change notification settings - Fork 7
75 lines (73 loc) · 2.62 KB
/
action.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
74
75
name: Push workflow for ocfl-py
on:
push:
branches-ignore:
- "main"
jobs:
tests_job:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pycodestyle pydocstyle pylint # For testing and linting
- name: Lint with pycodestyle
run: |
pycodestyle --ignore=E501,W503 *.py ocfl tests
- name: Lint with pydocstyle
run: |
pydocstyle *.py ocfl tests
- name: Lint with pylint
run: |
pylint --disable=line-too-long,raise-missing-from,fixme,redefined-builtin,invalid-name,consider-using-f-string,too-many-instance-attributes,too-many-return-statements,too-many-branches,too-many-arguments,too-many-locals,too-many-statements,too-many-nested-blocks,broad-exception-raised,superfluous-parens,duplicate-code *.py ocfl
pylint --disable=line-too-long,fixme,invalid-name,consider-using-f-string,too-many-statements,duplicate-code,protected-access tests
- name: Test with pytest
run: |
pytest
documentation_job:
needs: tests_job
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- uses: actions/checkout@v4
with:
submodules: true
- name: Update error codes
run: |
./extract_codes.py
- name: Build demo documenation
run: |
./build_demo_docs.sh
- name: Update github
run: |
gh pr comment $PR --body "Tests succeeded. Updating extracted errors codes and demo documentation..."
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "Update error codes and demo docs [actions skip]" docs
git push --verbose
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE: ${{ github.event.pr.html_url }}