-
Notifications
You must be signed in to change notification settings - Fork 3
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 #14 from openzim/zimfarm_readyness
Zimfarm readyness completed
- Loading branch information
Showing
78 changed files
with
1,841 additions
and
750 deletions.
There are no files selected for viewing
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,45 @@ | ||
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: scraper/pyproject.toml | ||
architecture: x64 | ||
|
||
- name: Build packages | ||
working-directory: scraper | ||
run: | | ||
pip install -U pip build | ||
python -m build --sdist --wheel | ||
- name: Upload to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1.8 | ||
with: | ||
packages-dir: scraper/dist/ | ||
|
||
- name: Build and push Docker image | ||
uses: openzim/docker-publish-action@v10 | ||
with: | ||
image-name: openzim/freecodecamp | ||
tag-pattern: /^v([0-9.]+)$/ | ||
latest-on-tag: true | ||
restrict-to: openzim/freecodecamp | ||
registries: ghcr.io | ||
credentials: | ||
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }} | ||
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }} | ||
repo_description: auto | ||
repo_overview: auto |
20 changes: 9 additions & 11 deletions
20
.github/workflows/docker.yaml → .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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,27 @@ | ||
name: Docker | ||
name: Publish Docker dev image | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
build-and-push: | ||
name: Deploy Docker Image | ||
publish: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3.4.0 | ||
- name: Build and push | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build and push Docker image | ||
uses: openzim/docker-publish-action@v10 | ||
with: | ||
image-name: openzim/freecodecamp | ||
on-master: dev | ||
tag-pattern: /^v([0-9.]+)$/ | ||
latest-on-tag: true | ||
manual-tag: dev | ||
latest-on-tag: false | ||
restrict-to: openzim/freecodecamp | ||
registries: ghcr.io | ||
credentials: | ||
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }} | ||
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }} | ||
repo_description: auto | ||
repo_overview: 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,66 @@ | ||
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: scraper/pyproject.toml | ||
architecture: x64 | ||
|
||
- name: Install dependencies (and project) | ||
working-directory: scraper | ||
run: | | ||
pip install -U pip | ||
pip install -e .[test,scripts] | ||
- name: Run the tests | ||
working-directory: scraper | ||
run: inv coverage --args "-vvv" | ||
|
||
- name: Upload coverage report to codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
directory: backend | ||
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: scraper/pyproject.toml | ||
architecture: x64 | ||
|
||
- name: Ensure we can build Python targets | ||
working-directory: scraper | ||
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 --version |
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 |
---|---|---|
@@ -1,39 +1,38 @@ | ||
name: QA | ||
|
||
on: | ||
push: | ||
branches: main | ||
pull_request: | ||
|
||
env: | ||
MAX_LINE_LENGTH: 88 | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
check-qa: | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
cache: 'pip' # caching pip dependencies | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version-file: scraper/pyproject.toml | ||
architecture: x64 | ||
|
||
- name: Install lint requirements | ||
- name: Install dependencies (and project) | ||
working-directory: scraper | ||
run: | | ||
pip install -r openzim/lint_requirements.txt | ||
pip install -U pip | ||
pip install -e .[lint,scripts,test,check] | ||
- name: Check black formatting | ||
run: | | ||
black --version | ||
black --check . | ||
working-directory: scraper | ||
run: inv lint-black | ||
|
||
- name: Check flake8 linting | ||
run: | | ||
flake8 --version | ||
flake8 . --count --max-line-length=$MAX_LINE_LENGTH --statistics | ||
- name: Check ruff | ||
working-directory: scraper | ||
run: inv lint-ruff | ||
|
||
- name: Check import order with isort | ||
run: | | ||
isort --version | ||
isort --profile black --check . | ||
- name: Check pyright | ||
working-directory: scraper | ||
run: inv check-pyright |
Oops, something went wrong.