Support single Python version (3.12) and move rewriting stuff from warc2zim to zimscraperlib #197
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: QA | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
generate-rules: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: pyproject.toml | |
architecture: x64 | |
- name: Install dependencies (and project) | |
run: | | |
pip install -U pip | |
pip install -e .[scripts] | |
- name: Generate rules | |
run: | | |
python rules/generate_rules.py | |
- name: Save rules artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
path: | | |
src/zimscraperlib/rewriting/rules.py | |
tests/rewriting/test_fuzzy_rules.py | |
javascript/src/fuzzyRules.js | |
javascript/test/fuzzyRules.js | |
name: rules_artifact | |
retention-days: 1 | |
check-python-qa: | |
runs-on: ubuntu-24.04 | |
needs: generate-rules | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Restore rules artifact | |
uses: actions/download-artifact@v4 | |
with: | |
path: | | |
src/zimscraperlib/rewriting/rules.py | |
tests/rewriting/test_fuzzy_rules.py | |
javascript/src/fuzzyRules.js | |
javascript/test/fuzzyRules.js | |
name: rules_artifact | |
- name: Temp check | |
run: | | |
pwd | |
ls -lah . | |
ls -lah rules | |
ls -lah src/zimscraperlib/rewriting | |
ls -lah /home/runner/work/python-scraperlib/python-scraperlib/src/zimscraperlib/rewriting | |
ls -lah rules_artifact | |
mv rules_artifacts/* . | |
ls -lah src/zimscraperlib/rewriting/rules.py | |
ls -lah tests/rewriting/test_fuzzy_rules.py | |
ls -lah javascript/src/fuzzyRules.js | |
ls -lah javascript/test/fuzzyRules.js | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: pyproject.toml | |
architecture: x64 | |
- name: Install dependencies (and project) | |
run: | | |
pip install -U pip | |
pip install -e .[lint,scripts,test,check] | |
- name: Check black formatting | |
run: inv lint-black | |
- name: Check ruff | |
run: inv lint-ruff | |
- name: Check pyright | |
run: inv check-pyright | |
check-javascript-qa: | |
runs-on: ubuntu-24.04 | |
needs: generate-rules | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Restore rules artifact | |
uses: actions/download-artifact@v4 | |
with: | |
path: | | |
src/zimscraperlib/rewriting/rules.py | |
tests/rewriting/test_fuzzy_rules.py | |
javascript/src/fuzzyRules.js | |
javascript/test/fuzzyRules.js | |
name: rules | |
- name: Temp check | |
run: | | |
ls -lah . | |
ls -lah src/zimscraperlib/rewriting/rules.py | |
ls -lah tests/rewriting/test_fuzzy_rules.py | |
ls -lah javascript/src/fuzzyRules.js | |
ls -lah javascript/test/fuzzyRules.js | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: 'javascript/package.json' | |
- name: Install JS dependencies | |
working-directory: javascript | |
run: yarn install | |
- name: Check prettier formatting | |
working-directory: javascript | |
run: yarn prettier-check | |
- name: Check eslint rules | |
working-directory: javascript | |
run: yarn eslint |