|
1 | | -name:Tests |
2 | | - |
3 | | -on: |
4 | | -workflow_dispatch: |
5 | | -push: |
6 | | -branches: |
7 | | - -'*.*' |
8 | | -pull_request: |
9 | | -branches: |
10 | | - -'*.*' |
11 | | - |
12 | | -jobs: |
13 | | -checks: |
14 | | -strategy: |
15 | | -matrix: |
16 | | -tool: |
17 | | - -name:sphinx-lint |
18 | | -package:sphinx-lint |
19 | | -command:'sphinx-lint --enable default-role --ignore .git' |
20 | | - -name:Line length |
21 | | -command:'awk''{if (length($0) > 80 && length(gensub(/[^ ]/, "", "g")) > 1) {print FILENAME ":" FNR, "line too long:", $0; ERRORS+=1}} END {if (ERRORS>0) {exit 1}}'' $CHANGED_PO_FILES' |
22 | | - |
23 | | -name:${{ matrix.tool.name }} (${{ matrix.tool.package }}) |
24 | | -runs-on:ubuntu-latest |
25 | | -steps: |
26 | | - -uses:actions/checkout@v3 |
27 | | - -uses:lots0logs/gh-action-get-changed-files@2.1.4 |
28 | | -id:changed_files |
29 | | -with: |
30 | | -token:${{ secrets.GITHUB_TOKEN }} |
31 | | - -uses:actions/setup-python@v4 |
32 | | -with: |
33 | | -python-version:'3.10' |
34 | | - -name:Install ${{ matrix.tool.package }} |
35 | | -run:| |
36 | | - if [ -n "${{ matrix.tool.apt_dependencies }}" ]; then |
37 | | - sudo apt-get update && sudo apt-get install -y ${{ matrix.tool.apt_dependencies }} |
38 | | - fi |
39 | | - if [ -n "${{ matrix.tool.package }}" ]; then |
40 | | - python -m pip install --upgrade pip setuptools wheel |
41 | | - python -m pip install ${{ matrix.tool.package }} |
42 | | - fi |
43 | | - -name:Run ${{ matrix.tool.package }} |
44 | | -env: |
45 | | -ADDED_FILES:${{ join(fromJSON(steps.changed_files.outputs.added), ' ') }} |
46 | | -MODIFIED_FILES:${{ join(fromJSON(steps.changed_files.outputs.modified), ' ') }} |
47 | | -run:| |
48 | | - CHANGED_PO_FILES=$(printf "%s %s\n" "$ADDED_FILES" "$MODIFIED_FILES" | tr ' ' '\n' | grep '.po$'; true) |
49 | | - pwd |
50 | | - tree -L 2 |
51 | | - if [ -n "$CHANGED_PO_FILES" ] |
52 | | - then |
53 | | - echo "Running on:" $CHANGED_PO_FILES |
54 | | - ${{ matrix.tool.command }} |
55 | | - else |
56 | | - echo "No changed po files, nothing to check." |
57 | | - fi |
58 | | -
|
59 | | -sphinx: |
60 | | -name:'Generate docs (sphinx)' |
61 | | -runs-on:ubuntu-latest |
62 | | -timeout-minutes:30 |
63 | | -steps: |
64 | | - -uses:actions/checkout@v3 |
65 | | - -uses:actions/setup-python@v4 |
66 | | -with: |
67 | | -python-version:'3.10' |
68 | | - -name:Prepare environment |
69 | | -run:| |
70 | | - pwd |
71 | | - tree -L 2 |
72 | | - git clone https://github.com/python/cpython.git venv/cpython/ |
73 | | - python -m pip install --upgrade pip setuptools wheel |
74 | | - python -m pip install -r requirements.txt -r venv/cpython/Doc/requirements.txt |
75 | | - -name:Make |
76 | | -run:make |
| 1 | +name:Tests |
| 2 | + |
| 3 | +on: |
| 4 | +workflow_dispatch: |
| 5 | +push: |
| 6 | +branches: |
| 7 | + -'**' |
| 8 | +pull_request: |
| 9 | +branches: |
| 10 | + -'**' |
| 11 | + |
| 12 | +jobs: |
| 13 | +checks: |
| 14 | +strategy: |
| 15 | +matrix: |
| 16 | +tool: |
| 17 | + -name:sphinx-lint |
| 18 | +package:sphinx-lint |
| 19 | +command:'sphinx-lint --enable default-role --ignore .git' |
| 20 | + -name:Line length |
| 21 | +command:'awk''{if (length($0) > 80 && length(gensub(/[^ ]/, "", "g")) > 1) {print FILENAME ":" FNR, "line too long:", $0; ERRORS+=1}} END {if (ERRORS>0) {exit 1}}'' $CHANGED_PO_FILES' |
| 22 | + |
| 23 | +name:${{ matrix.tool.name }} (${{ matrix.tool.package }}) |
| 24 | +runs-on:ubuntu-latest |
| 25 | +steps: |
| 26 | + -uses:actions/checkout@v3 |
| 27 | + -uses:lots0logs/gh-action-get-changed-files@2.1.4 |
| 28 | +id:changed_files |
| 29 | +with: |
| 30 | +token:${{ secrets.GITHUB_TOKEN }} |
| 31 | + -uses:actions/setup-python@v4 |
| 32 | +with: |
| 33 | +python-version:'3.11' |
| 34 | + -name:Install ${{ matrix.tool.package }} |
| 35 | +run:| |
| 36 | + if [ -n "${{ matrix.tool.apt_dependencies }}" ]; then |
| 37 | + sudo apt-get update && sudo apt-get install -y ${{ matrix.tool.apt_dependencies }} |
| 38 | + fi |
| 39 | + if [ -n "${{ matrix.tool.package }}" ]; then |
| 40 | + python -m pip install --upgrade pip setuptools wheel |
| 41 | + python -m pip install ${{ matrix.tool.package }} |
| 42 | + fi |
| 43 | + -name:Run ${{ matrix.tool.package }} |
| 44 | +env: |
| 45 | +ADDED_FILES:${{ join(fromJSON(steps.changed_files.outputs.added), ' ') }} |
| 46 | +MODIFIED_FILES:${{ join(fromJSON(steps.changed_files.outputs.modified), ' ') }} |
| 47 | +run:| |
| 48 | + CHANGED_PO_FILES=$(printf "%s %s\n" "$ADDED_FILES" "$MODIFIED_FILES" | tr ' ' '\n' | grep '.po$'; true) |
| 49 | + pwd |
| 50 | + tree -L 2 |
| 51 | + if [ -n "$CHANGED_PO_FILES" ] |
| 52 | + then |
| 53 | + echo "Running on:" $CHANGED_PO_FILES |
| 54 | + ${{ matrix.tool.command }} |
| 55 | + else |
| 56 | + echo "No changed po files, nothing to check." |
| 57 | + fi |
| 58 | +
|
| 59 | +sphinx: |
| 60 | +name:'Generate docs (sphinx)' |
| 61 | +runs-on:ubuntu-latest |
| 62 | +timeout-minutes:30 |
| 63 | +steps: |
| 64 | + -uses:actions/checkout@v3 |
| 65 | + -uses:actions/setup-python@v4 |
| 66 | +with: |
| 67 | +python-version:'3.11' |
| 68 | + -name:Prepare environment |
| 69 | +run:| |
| 70 | + pwd |
| 71 | + tree -L 2 |
| 72 | + git clone https://github.com/python/cpython.git venv/cpython/ |
| 73 | + python -m pip install --upgrade pip setuptools wheel |
| 74 | + python -m pip install -r requirements.txt -r venv/cpython/Doc/requirements.txt |
| 75 | + -name:Make |
| 76 | +run:make |