-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from openzim/issue_46
Migrate to our new Python standard + Zimscraperlib 3.1 + fix few issues
- Loading branch information
Showing
47 changed files
with
1,321 additions
and
287 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Tests | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
run-tests: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
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 "-vvv" | ||
|
||
- name: Upload coverage report to codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
- name: Ensure we can build targets | ||
run: | | ||
pip install build | ||
python3 -m build |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Build and upload to PyPI | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
id-token: write # mandatory for PyPI trusted publishing | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version-file: pyproject.toml | ||
architecture: x64 | ||
|
||
- name: Build packages | ||
run: | | ||
pip install -U pip build | ||
python -m build sdist wheel | ||
- name: Upload to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1.8 | ||
|
||
- name: Build and push Docker image | ||
uses: openzim/docker-publish-action@v10 | ||
with: | ||
image-name: openzim/kolibri | ||
tag-pattern: /^v([0-9.]+)$/ | ||
latest-on-tag: true | ||
restrict-to: openzim/kolibri | ||
registries: ghcr.io | ||
credentials: | ||
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }} | ||
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }} | ||
repo_description: auto | ||
repo_overview: auto |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: Pull Request | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
qa: | ||
uses: ./.github/workflows/qa.yml | ||
# run qa job if the pull request originates from a fork (otherwise the qa is already triggered by the push to a branch) | ||
if: github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
name: Push | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
qa: | ||
uses: ./.github/workflows/qa.yml |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: QA | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
check-qa: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version-file: pyproject.toml | ||
architecture: x64 | ||
|
||
- name: Install dependencies (and project) | ||
run: | | ||
pip install -U pip | ||
pip install -e .[lint,check,scripts,test] | ||
- name: Check black formatting | ||
run: inv lint-black | ||
|
||
- name: Check ruff | ||
run: inv lint-ruff | ||
|
||
- name: Check pyright | ||
run: inv check-pyright |
Oops, something went wrong.