-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
742 additions
and
313 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,60 @@ | ||
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 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- name: install handlebars | ||
run: | | ||
npm install -g handlebars | ||
- 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 | ||
# dont specify anything for Trusted Publishing | ||
# https://docs.pypi.org/trusted-publishers | ||
# with: | ||
# # Using token | ||
# user: __token__ | ||
# password: ${{ secrets.PYPI_API_TOKEN }} | ||
# | ||
# # Using token on test index | ||
# password: ${{ secrets.PYPI_TEST_API_TOKEN }} | ||
# repository_url: https://test.pypi.org/legacy/ | ||
|
||
- name: Build and push Docker image | ||
uses: openzim/docker-publish-action@v10 | ||
with: | ||
image-name: openzim/nautilus | ||
tag-pattern: /^v([0-9.]+)$/ | ||
latest-on-tag: true | ||
restrict-to: openzim/nautilus | ||
registries: ghcr.io | ||
credentials: | ||
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }} | ||
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }} | ||
repo_description: auto | ||
repo_overview: auto |
18 changes: 8 additions & 10 deletions
18
.github/workflows/docker.yml → .github/workflows/PublishDockerDevImage.yaml
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
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: QA | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
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 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- name: install handlebars | ||
run: | | ||
npm install -g handlebars | ||
- 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 |
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,83 @@ | ||
name: Tests | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
run-tests: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-22.04] | ||
python: ["3.11", "3.12"] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
architecture: x64 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- name: install handlebars | ||
run: | | ||
npm install -g handlebars | ||
- 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 | ||
if: matrix.python == '3.12' | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
build_python: | ||
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: Ensure we can build Python targets | ||
run: | | ||
pip install -U pip build | ||
python3 -m build --sdist --wheel | ||
build_docker: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Ensure we can build the Docker image | ||
run: | | ||
docker build -t testimage . | ||
- name: Ensure we can start the Docker image | ||
run: | | ||
docker run --rm testimage | ||
# OR if image is a daemon process | ||
# - name: Ensure we can start the Docker image | ||
# run: | | ||
# docker run --rm testimage | ||
# sleep 5 | ||
# docker ps | grep test_container | ||
# docker stop test_container |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.