Skip to content

Commit

Permalink
Merge pull request #228 from openzim/fix_js_rewriting
Browse files Browse the repository at this point in the history
Fix Javascript rewriting: module detection + wombat JS URL rewriting / enhance Vimeo support
  • Loading branch information
benoit74 authored May 2, 2024
2 parents b5e1a91 + fe62acb commit c97832e
Show file tree
Hide file tree
Showing 46 changed files with 4,663 additions and 407 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/Publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ jobs:
python-version-file: pyproject.toml
architecture: x64

- name: Generate fuzzy rules
run: python rules/generate_rules.py

- name: Build Javascript wombatSetup.js
uses: addnab/docker-run-action@v3
with:
image: node:20-bookworm
options: -v ${{ github.workspace }}/src/warc2zim/statics:/output -v ${{ github.workspace }}/rules:/src/rules -v ${{ github.workspace }}/javascript:/src/javascript -v ${{ github.workspace }}/build_js.sh:/src/build_js.sh
run: |
/src/build_js.sh
- name: Build packages
run: |
pip install -U pip build
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/PublishDockerDevImage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Build Javascript wombatSetup.js
uses: addnab/docker-run-action@v3
with:
image: node:20-bookworm
options: -v ${{ github.workspace }}/src/warc2zim/statics:/output -v ${{ github.workspace }}/rules:/src/rules -v ${{ github.workspace }}/javascript:/src/javascript -v ${{ github.workspace }}/build_js.sh:/src/build_js.sh
run: |
/src/build_js.sh
- name: Build and push Docker image
uses: openzim/docker-publish-action@v10
with:
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/QA.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
pip install -U pip
pip install -e .[lint,scripts,test,check]
- name: Generate fuzzy rules
run: python rules/generate_rules.py

- name: Check black formatting
run: inv lint-black

Expand All @@ -32,3 +35,20 @@ jobs:

- name: Check pyright
run: inv check-pyright

- name: Set up Node.JS
uses: actions/setup-node@v4
with:
node-version: 20

- 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
24 changes: 24 additions & 0 deletions .github/workflows/Tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
pip install -U pip
pip install -e .[test,scripts]
- name: Generate fuzzy rules
run: python rules/generate_rules.py

- name: Run the tests
run: inv coverage --args "-vvv"

Expand All @@ -32,6 +35,19 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Set up Node.JS
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install JS dependencies
working-directory: javascript
run: yarn install

- name: Run JS tests
working-directory: javascript
run: yarn test

build_python:
runs-on: ubuntu-22.04
steps:
Expand All @@ -43,6 +59,14 @@ jobs:
python-version-file: pyproject.toml
architecture: x64

- name: Install dependencies (and project)
run: |
pip install -U pip build
pip install -e .
- name: Generate fuzzy rules
run: python rules/generate_rules.py

- name: Ensure we can build Python targets
run: |
pip install -U pip build
Expand Down
Loading

0 comments on commit c97832e

Please sign in to comment.