Skip to content

Support single Python version (3.12) and move rewriting stuff from warc2zim to zimscraperlib #208

Support single Python version (3.12) and move rewriting stuff from warc2zim to zimscraperlib

Support single Python version (3.12) and move rewriting stuff from warc2zim to zimscraperlib #208

Workflow file for this run

name: Tests
on:
pull_request:
push:
branches:
- main
jobs:
generate-rules:
runs-on: ubuntu-24.04
steps:
- name: Checkout repo
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
retention-days: 1
run-python-tests:
runs-on: ubuntu-24.04
needs: generate-rules
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Restore rules artifact
uses: actions/download-artifact@v4
with:
name: rules
- name: install ffmpeg and gifsicle
run: sudo apt update && sudo apt install ffmpeg gifsicle
- name: Set up Python 3.12
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 .[test,scripts]
- name: Run the tests
run: inv coverage --args "--runslow --runinstalled -vvv"
- name: Upload coverage report to codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
build_python:
runs-on: ubuntu-24.04
needs: generate-rules
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Restore rules artifact
uses: actions/download-artifact@v4
with:
name: rules
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: pyproject.toml
architecture: x64
- name: Ensure we can build Python targets
run: |
pip install -U pip build
python3 -m build --sdist --wheel
build_javascript:
runs-on: ubuntu-24.04
needs: generate-rules
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Restore rules artifact
uses: actions/download-artifact@v4
with:
name: rules
- name: Setup Node.JS
uses: actions/setup-node@v4
with:
node-version-file: 'javascript/package.json'
- name: Install JS dependencies
run: yarn install
working-directory: javascript
- name: Build development JS
run: yarn build-dev
working-directory: javascript
- name: Build production JS
run: yarn build-prod
working-directory: javascript
- name: Build JS package
run: yarn pack
working-directory: javascript