👷(ci) fix CI running in github actions
The CI configuration file was translated from CircleCI to github actions a bit too fast and had not been tested yet.
This commit is contained in:
committed by
Samuel Paccoud
parent
8ebfb8715d
commit
b5a46eba33
127
.github/workflows/people.yml
vendored
127
.github/workflows/people.yml
vendored
@@ -4,26 +4,33 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- '*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint-git:
|
lint-git:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event_name == 'pull_request' # Makes sense only for pull requests
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: show
|
||||||
|
run: git log
|
||||||
- name: Enforce absence of print statements in code
|
- name: Enforce absence of print statements in code
|
||||||
run: |
|
run: |
|
||||||
! git diff origin/main..HEAD -- . ':(exclude).circleci' | grep "print("
|
! git diff origin/${{ github.event.pull_request.base.ref }}..HEAD -- . ':(exclude)**/people.yml' | grep "print("
|
||||||
- name: Check absence of fixup commits
|
- name: Check absence of fixup commits
|
||||||
run: |
|
run: |
|
||||||
! git log | grep 'fixup!'
|
! git log | grep 'fixup!'
|
||||||
- name: Install gitlint
|
- name: Install gitlint
|
||||||
run: pip install --user requests gitlint
|
run: pip install --user requests gitlint
|
||||||
- name: Lint commit messages added to main
|
- name: Lint commit messages added to main
|
||||||
run: ~/.local/bin/gitlint --commits origin/main..HEAD
|
run: ~/.local/bin/gitlint --commits origin/${{ github.event.pull_request.base.ref }}..HEAD
|
||||||
|
|
||||||
check-changelog:
|
check-changelog:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -48,6 +55,9 @@ jobs:
|
|||||||
|
|
||||||
build-mails:
|
build-mails:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: src/mail
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
@@ -77,8 +87,11 @@ jobs:
|
|||||||
- name: Check built image availability
|
- name: Check built image availability
|
||||||
run: docker images "people:${{ github.sha }}*"
|
run: docker images "people:${{ github.sha }}*"
|
||||||
|
|
||||||
build-back:
|
lint-back:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: src/backend
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
@@ -88,14 +101,6 @@ jobs:
|
|||||||
python-version: '3.10'
|
python-version: '3.10'
|
||||||
- name: Install development dependencies
|
- name: Install development dependencies
|
||||||
run: pip install --user .[dev]
|
run: pip install --user .[dev]
|
||||||
working-directory: src/backend
|
|
||||||
- name: Cache dependencies
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: ~/.local
|
|
||||||
key: v1-back-dependencies-${{ hashFiles('src/backend/requirements.txt') }}
|
|
||||||
restore-keys: |
|
|
||||||
v1-back-dependencies-
|
|
||||||
- name: Check code formatting with ruff
|
- name: Check code formatting with ruff
|
||||||
run: ~/.local/bin/ruff format people --diff
|
run: ~/.local/bin/ruff format people --diff
|
||||||
- name: Lint code with ruff
|
- name: Lint code with ruff
|
||||||
@@ -105,27 +110,46 @@ jobs:
|
|||||||
|
|
||||||
test-back:
|
test-back:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: src/backend
|
||||||
|
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:16
|
image: postgres:16
|
||||||
env:
|
env:
|
||||||
POSTGRES_DB: test_people
|
POSTGRES_DB: people
|
||||||
POSTGRES_USER: dinum
|
POSTGRES_USER: dinum
|
||||||
POSTGRES_PASSWORD: pass
|
POSTGRES_PASSWORD: pass
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
|
# needed because the postgres container does not provide a healthcheck
|
||||||
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
||||||
|
|
||||||
|
env:
|
||||||
|
DJANGO_CONFIGURATION: Test
|
||||||
|
DJANGO_SETTINGS_MODULE: people.settings
|
||||||
|
DJANGO_SECRET_KEY: ThisIsAnExampleKeyForTestPurposeOnly
|
||||||
|
DJANGO_JWT_PRIVATE_SIGNING_KEY: ThisIsAnExampleKeyForDevPurposeOnly
|
||||||
|
DB_HOST: localhost
|
||||||
|
DB_NAME: people
|
||||||
|
DB_USER: dinum
|
||||||
|
DB_PASSWORD: pass
|
||||||
|
DB_PORT: 5432
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
- name: Create writable /data
|
||||||
|
run: |
|
||||||
|
sudo mkdir -p /data/media && \
|
||||||
|
sudo mkdir -p /data/static
|
||||||
- name: Install Python
|
- name: Install Python
|
||||||
uses: actions/setup-python@v3
|
uses: actions/setup-python@v3
|
||||||
with:
|
with:
|
||||||
python-version: '3.10'
|
python-version: '3.10'
|
||||||
- name: Install dependencies
|
- name: Install development dependencies
|
||||||
run: pip install --user -r src/backend/requirements.txt
|
run: pip install --user .[dev]
|
||||||
- name: Create writable /data
|
|
||||||
run: |
|
|
||||||
sudo mkdir -p /data/media && \
|
|
||||||
sudo mkdir -p /data/static && \
|
|
||||||
sudo chown -R $USER:$USER /data
|
|
||||||
- name: Install gettext (required to compile messages)
|
- name: Install gettext (required to compile messages)
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
@@ -135,67 +159,38 @@ jobs:
|
|||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: ~/.local/bin/pytest -n 2
|
run: ~/.local/bin/pytest -n 2
|
||||||
|
|
||||||
build-back-i18n:
|
i18n-back:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Attach workspace
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
path: ~/people
|
|
||||||
- name: Install Python
|
|
||||||
uses: actions/setup-python@v3
|
|
||||||
with:
|
|
||||||
python-version: '3.10'
|
|
||||||
- name: Install gettext (required to make messages)
|
- name: Install gettext (required to make messages)
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y gettext
|
sudo apt-get install -y gettext
|
||||||
- name: Generate and persist the translations base file
|
|
||||||
run: ~/.local/bin/django-admin makemessages --keep-pot --all
|
|
||||||
- name: Persist translations to workspace
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: translations
|
|
||||||
path: src/backend/locale
|
|
||||||
|
|
||||||
upload-i18n-strings:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
- name: Attach workspace
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
path: ~/people
|
|
||||||
- name: Upload files to Crowdin
|
|
||||||
run: crowdin upload sources -c crowdin/config.yml
|
|
||||||
|
|
||||||
package-back:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
- name: Install Python
|
- name: Install Python
|
||||||
uses: actions/setup-python@v3
|
uses: actions/setup-python@v3
|
||||||
with:
|
with:
|
||||||
python-version: '3.10'
|
python-version: '3.10'
|
||||||
- name: Build python package
|
- name: Install development dependencies
|
||||||
run: python setup.py sdist bdist_wheel
|
working-directory: src/backend
|
||||||
- name: Persist build packages to workspace
|
run: pip install --user .[dev]
|
||||||
uses: actions/upload-artifact@v2
|
- name: Generate the translation base file
|
||||||
with:
|
run: ~/.local/bin/django-admin makemessages --keep-pot --all
|
||||||
name: packages
|
- name: Upload files to Crowdin
|
||||||
path: src/backend/dist
|
run: |
|
||||||
- name: Store packages as artifacts
|
docker run \
|
||||||
uses: actions/upload-artifact@v2
|
--rm \
|
||||||
with:
|
-e CROWDIN_API_TOKEN=${{ secrets.CROWDIN_API_TOKEN }} \
|
||||||
name: packages
|
-e CROWDIN_PROJECT_ID=${{ vars.CROWDIN_PROJECT_ID }} \
|
||||||
path: src/backend/dist
|
-e CROWDIN_BASE_PATH=${{ vars.CROWDIN_BASE_PATH }} \
|
||||||
|
-v "${{ github.workspace }}:/app" \
|
||||||
|
crowdin/cli:3.16.0 \
|
||||||
|
crowdin upload sources -c /app/crowdin/config.yml
|
||||||
|
|
||||||
hub:
|
hub:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ USER ${DOCKER_USER}
|
|||||||
COPY --from=link-collector ${PEOPLE_STATIC_ROOT} ${PEOPLE_STATIC_ROOT}
|
COPY --from=link-collector ${PEOPLE_STATIC_ROOT} ${PEOPLE_STATIC_ROOT}
|
||||||
|
|
||||||
# Copy people mails
|
# Copy people mails
|
||||||
COPY --from=mail-builder /mail/backend/people/core/templates/mail /app/people/core/templates/mail
|
COPY --from=mail-builder /mail/backend/core/templates/mail /app/core/templates/mail
|
||||||
|
|
||||||
# The default command runs gunicorn WSGI server in people's main module
|
# The default command runs gunicorn WSGI server in people's main module
|
||||||
CMD gunicorn -c /usr/local/etc/gunicorn/people.py people.wsgi:application
|
CMD gunicorn -c /usr/local/etc/gunicorn/people.py people.wsgi:application
|
||||||
|
|||||||
6
Makefile
6
Makefile
@@ -217,14 +217,12 @@ crowdin-upload: ## Upload source translations to crowdin
|
|||||||
|
|
||||||
i18n-compile: ## compile all translations
|
i18n-compile: ## compile all translations
|
||||||
i18n-compile: \
|
i18n-compile: \
|
||||||
back-i18n-compile \
|
back-i18n-compile
|
||||||
admin-i18n-compile
|
|
||||||
.PHONY: i18n-compile
|
.PHONY: i18n-compile
|
||||||
|
|
||||||
i18n-generate: ## create the .pot files and extract frontend messages
|
i18n-generate: ## create the .pot files and extract frontend messages
|
||||||
i18n-generate: \
|
i18n-generate: \
|
||||||
back-i18n-generate \
|
back-i18n-generate
|
||||||
admin-i18n-extract
|
|
||||||
.PHONY: i18n-generate
|
.PHONY: i18n-generate
|
||||||
|
|
||||||
i18n-download-and-compile: ## download all translated messages and compile them to be used by all applications
|
i18n-download-and-compile: ## download all translated messages and compile them to be used by all applications
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ services:
|
|||||||
image: jwilder/dockerize
|
image: jwilder/dockerize
|
||||||
|
|
||||||
crowdin:
|
crowdin:
|
||||||
image: crowdin/cli:3.5.2
|
image: crowdin/cli:3.16.0
|
||||||
volumes:
|
volumes:
|
||||||
- ".:/app"
|
- ".:/app"
|
||||||
env_file:
|
env_file:
|
||||||
|
|||||||
0
src/backend/core/tests/swagger/__init__.py
Normal file
0
src/backend/core/tests/swagger/__init__.py
Normal file
@@ -14,10 +14,28 @@ pytestmark = pytest.mark.django_db
|
|||||||
|
|
||||||
def test_openapi_client_schema():
|
def test_openapi_client_schema():
|
||||||
"""
|
"""
|
||||||
Generated OpenAPI client schema should be correct.
|
Generated and served OpenAPI client schema should be correct.
|
||||||
"""
|
"""
|
||||||
|
# Start by generating the swagger.json file
|
||||||
|
output = StringIO()
|
||||||
|
call_command(
|
||||||
|
"spectacular",
|
||||||
|
"--api-version",
|
||||||
|
"v1.0",
|
||||||
|
"--urlconf",
|
||||||
|
"people.api_urls",
|
||||||
|
"--format",
|
||||||
|
"openapi-json",
|
||||||
|
"--file",
|
||||||
|
"core/tests/swagger/swagger.json",
|
||||||
|
stdout=output,
|
||||||
|
)
|
||||||
|
assert output.getvalue() == ""
|
||||||
|
|
||||||
response = Client().get("/v1.0/swagger.json")
|
response = Client().get("/v1.0/swagger.json")
|
||||||
|
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
with open("core/tests/swagger/swagger.json") as expected_schema:
|
with open(
|
||||||
|
"core/tests/swagger/swagger.json", "r", encoding="utf-8"
|
||||||
|
) as expected_schema:
|
||||||
assert response.json() == json.load(expected_schema)
|
assert response.json() == json.load(expected_schema)
|
||||||
|
|||||||
BIN
src/backend/locale/fr_FR/LC_MESSAGES/django.mo
Normal file
BIN
src/backend/locale/fr_FR/LC_MESSAGES/django.mo
Normal file
Binary file not shown.
191
src/backend/locale/fr_FR/LC_MESSAGES/django.po
Normal file
191
src/backend/locale/fr_FR/LC_MESSAGES/django.po
Normal file
@@ -0,0 +1,191 @@
|
|||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: lasuite-people\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2024-01-03 23:15+0000\n"
|
||||||
|
"PO-Revision-Date: 2024-01-03 23:15\n"
|
||||||
|
"Last-Translator: \n"
|
||||||
|
"Language-Team: French\n"
|
||||||
|
"Language: fr_FR\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||||
|
"X-Crowdin-Project: lasuite-people\n"
|
||||||
|
"X-Crowdin-Project-ID: 637934\n"
|
||||||
|
"X-Crowdin-Language: fr\n"
|
||||||
|
"X-Crowdin-File: backend.pot\n"
|
||||||
|
"X-Crowdin-File-ID: 2\n"
|
||||||
|
|
||||||
|
#: core/models.py:30
|
||||||
|
msgid "Member"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:31
|
||||||
|
msgid "Administrator"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:32
|
||||||
|
msgid "Owner"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:44
|
||||||
|
msgid "id"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:45
|
||||||
|
msgid "primary key for the record as UUID"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:51
|
||||||
|
msgid "created on"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:52
|
||||||
|
msgid "date and time at which a record was created"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:57
|
||||||
|
msgid "updated on"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:58
|
||||||
|
msgid "date and time at which a record was last updated"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:89
|
||||||
|
msgid "full name"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:90
|
||||||
|
msgid "short name"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:95
|
||||||
|
msgid "contact information"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:96
|
||||||
|
msgid "A JSON object containing the contact information"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:110
|
||||||
|
msgid "contact"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:111
|
||||||
|
msgid "contacts"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:173
|
||||||
|
msgid "language"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:174
|
||||||
|
msgid "The language in which the user wants to see the interface."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:180
|
||||||
|
msgid "The timezone in which the user wants to see times."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:183
|
||||||
|
msgid "device"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:185
|
||||||
|
msgid "Whether the user is a device or a real user."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:188
|
||||||
|
msgid "staff status"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:190
|
||||||
|
msgid "Whether the user can log into this admin site."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:193
|
||||||
|
msgid "active"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:196
|
||||||
|
msgid "Whether this user should be treated as active. Unselect this instead of deleting accounts."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:208
|
||||||
|
msgid "user"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:209
|
||||||
|
msgid "users"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:245
|
||||||
|
msgid "Enter a valid sub. This value may contain only letters, numbers, and @/./+/-/_ characters."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:252
|
||||||
|
msgid "sub"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:254
|
||||||
|
msgid "Required. 255 characters or fewer. Letters, numbers, and @/./+/-/_ characters only."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:260
|
||||||
|
msgid "email address"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:262
|
||||||
|
msgid "main"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:264
|
||||||
|
msgid "Designates whether the email is the main one."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:270
|
||||||
|
msgid "identity"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:271
|
||||||
|
msgid "identities"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:278
|
||||||
|
msgid "This email address is already declared for this user."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:323
|
||||||
|
msgid "Team"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:324
|
||||||
|
msgid "Teams"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:375
|
||||||
|
msgid "Team/user relation"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:376
|
||||||
|
msgid "Team/user relations"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:381
|
||||||
|
msgid "This user is already in this team."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: core/models.py:451
|
||||||
|
msgid "Token contained no recognizable user identification"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: people/settings.py:132
|
||||||
|
msgid "English"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: people/settings.py:133
|
||||||
|
msgid "French"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
Reference in New Issue
Block a user