-
-
Notifications
You must be signed in to change notification settings - Fork 15
Break everything and introduce i18n #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,63 @@ | ||
name: Tests | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test-api: | ||
runs-on: ubuntu-24.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: api/pyproject.toml | ||
architecture: x64 | ||
|
||
- name: Install dependencies (and project) | ||
working-directory: api | ||
run: | | ||
pip install -U pip | ||
pip install -e .[test,scripts] | ||
|
||
- name: Run the tests | ||
working-directory: api | ||
run: inv coverage --args "-vvv" | ||
|
||
- name: Upload coverage report to codecov | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
fail_ci_if_error: true | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
benoit74 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
build_docker: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Ensure we can build the Docker image for UI | ||
run: | | ||
docker build -t zimitfrontend-ui . -f Dockerfile-ui | ||
|
||
- name: Ensure we can start the Docker image for UI | ||
run: | | ||
docker run -d --rm --name test_container zimitfrontend-ui | ||
sleep 5 | ||
docker ps | grep test_container | ||
docker stop test_container | ||
|
||
- name: Ensure we can build the Docker image for API | ||
run: | | ||
docker build -t zimitfrontend-api . -f Dockerfile-api | ||
|
||
- name: Ensure we can start the Docker image for API | ||
run: | | ||
docker run -d --rm --name test_container zimitfrontend-api | ||
sleep 5 | ||
docker ps | grep test_container | ||
docker stop test_container |
This file contains hidden or 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 |
---|---|---|
|
@@ -129,3 +129,6 @@ dmypy.json | |
.pyre/ | ||
|
||
.DS_Store | ||
|
||
# ignore all vscode, this is not standard configuration in this place | ||
.vscode |
This file contains hidden or 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 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.6.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- repo: https://github.com/psf/black | ||
rev: "24.8.0" | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.6.5 | ||
hooks: | ||
- id: ruff | ||
- repo: https://github.com/RobertCraigie/pyright-python | ||
rev: v1.1.380 | ||
hooks: | ||
- id: pyright | ||
name: pyright (system) | ||
description: 'pyright static type checker' | ||
entry: pyright | ||
language: system | ||
'types_or': [python, pyi] | ||
require_serial: true | ||
minimum_pre_commit_version: '2.9.2' | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v3.1.0 | ||
hooks: | ||
- id: prettier | ||
files: ui\/.*$ # files in javascript folder | ||
- repo: https://github.com/pre-commit/mirrors-eslint | ||
rev: v8.56.0 # for some reasons, 8.57.0 has not been published | ||
hooks: | ||
- id: eslint | ||
types: [file] | ||
files: ui\/.*(?:\.[jt]sx?|\.vue)$ # *.js, *.jsx, *.ts, *.tsx, *.vue in ui/src folder | ||
args: | ||
- --config | ||
- ui/.eslintrc.cjs | ||
- --no-ignore |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,36 @@ | ||
|
||
FROM python:3.12-alpine | ||
LABEL org.opencontainers.image.source https://github.com/openzim/zimit-frontend | ||
|
||
# Specifying a workdir which is not "/"" is mandatory for proper uvicorn watchfiles | ||
# operation (used mostly only in dev, but changing the workdir does not harm production) | ||
WORKDIR "/home" | ||
|
||
# Install necessary packages (only pip so far) | ||
RUN python -m pip install --no-cache-dir -U \ | ||
pip | ||
|
||
# Set to your client origin(s) | ||
ENV ALLOWED_ORIGINS http://localhost:8001|http://127.0.0.1:8001 | ||
|
||
# Copy minimal files for installation of project dependencies | ||
COPY api/pyproject.toml api/README.md /src/ | ||
COPY api/src/zimitfrontend/__about__.py /src/src/zimitfrontend/__about__.py | ||
|
||
# Install project dependencies | ||
RUN pip install --no-cache-dir /src | ||
|
||
# Copy code + associated artifacts | ||
COPY api/src /src/src | ||
COPY api/*.md /src/ | ||
|
||
# Install project + cleanup afterwards | ||
RUN pip install --no-cache-dir /src \ | ||
&& rm -rf /src | ||
|
||
ENV LOCALES_LOCATION /locales | ||
COPY locales /locales | ||
|
||
EXPOSE 80 | ||
|
||
CMD ["uvicorn", "zimitfrontend.entrypoint:app", "--host", "0.0.0.0", "--port", "80"] |
This file contains hidden or 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,22 @@ | ||
FROM node:20-alpine as ui_builder | ||
|
||
RUN apk --no-cache add yarn | ||
WORKDIR /src/ui | ||
COPY ui/package.json ui/yarn.lock /src/ui/ | ||
RUN yarn install | ||
COPY ui/index.html /src/ui/ | ||
COPY ui/*.json /src/ui/ | ||
COPY ui/*.ts /src/ui/ | ||
COPY ui/*.js /src/ui/ | ||
COPY ui/public /src/ui/public | ||
COPY ui/src /src/ui/src | ||
COPY locales /src/locales | ||
RUN NODE_ENV=production yarn build | ||
|
||
|
||
FROM caddy:2.8-alpine | ||
LABEL org.opencontainers.image.source https://github.com/openzim/zimit-frontend | ||
|
||
COPY --from=ui_builder /src/ui/dist /usr/share/caddy | ||
|
||
COPY locales /locales |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.