Skip to content

Commit c1a391f

Browse files
committed
Initial commit
0 parents  commit c1a391f

File tree

140 files changed

+36462
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+36462
-0
lines changed

.editorconfig

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
# EditorConfig Configuration file, for more details see:
3+
# https://EditorConfig.org
4+
# EditorConfig is a convention description, that could be interpreted
5+
# by multiple editors to enforce common coding conventions for specific
6+
# file types
7+
8+
# top-most EditorConfig file:
9+
# Will ignore other EditorConfig files in Home directory or upper tree level.
10+
root = true
11+
12+
13+
[*] # For All Files
14+
# Unix-style newlines with a newline ending every file
15+
end_of_line = lf
16+
insert_final_newline = true
17+
trim_trailing_whitespace = true
18+
# Set default charset
19+
charset = utf-8
20+
# Indent style default
21+
indent_style = space
22+
23+
[*.{py,cfg,ini}]
24+
# 4 space indentation
25+
indent_size = 4
26+
27+
[*.{html,dtml,pt,zpt,xml,zcml,js,json,ts,less,scss,css,sass,yml,yaml}]
28+
# 2 space indentation
29+
indent_size = 2
30+
31+
[{Makefile,.gitmodules}]
32+
# Tab indentation (no size specified, but view as 4 spaces)
33+
indent_style = tab
34+
indent_size = unset
35+
tab_width = unset
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Backend CI
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
image-name-prefix:
7+
required: true
8+
type: string
9+
image-name-suffix:
10+
required: true
11+
type: string
12+
plone-version:
13+
required: true
14+
type: string
15+
16+
defaults:
17+
run:
18+
working-directory: backend
19+
20+
jobs:
21+
22+
release:
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: read
26+
packages: write
27+
28+
steps:
29+
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Docker meta
34+
id: meta
35+
uses: docker/metadata-action@v5
36+
with:
37+
images: |
38+
${{ inputs.image-name-prefix }}-${{ inputs.image-name-suffix }}
39+
labels: |
40+
org.label-schema.docker.cmd=docker run -d -p 8080:8080 ${{ inputs.image-name-prefix }}-${{ inputs.image-name-suffix }}:${{ inputs.base-tag }}
41+
flavor:
42+
latest=false
43+
tags: |
44+
type=ref,event=branch
45+
type=sha
46+
type=raw,value=latest,enable={{is_default_branch}}
47+
48+
- name: Set up QEMU
49+
uses: docker/setup-qemu-action@v3
50+
51+
- name: Set up Docker Buildx
52+
uses: docker/setup-buildx-action@v3
53+
54+
- name: Login to Container Registry
55+
uses: docker/login-action@v3
56+
with:
57+
registry: ghcr.io
58+
username: ${{ github.actor }}
59+
password: ${{ secrets.GITHUB_TOKEN }}
60+
61+
- name: Build and push
62+
uses: docker/build-push-action@v5
63+
with:
64+
platforms: linux/amd64
65+
context: backend/
66+
file: backend/Dockerfile
67+
push: ${{ github.event_name != 'pull_request' }}
68+
tags: ${{ steps.meta.outputs.tags }}
69+
labels: ${{ steps.meta.outputs.labels }}
70+
build-args: |
71+
PLONE_VERSION=${{ inputs.plone-version }}

.github/workflows/backend.yml

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: Backend CI
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
python-version:
7+
required: true
8+
type: string
9+
plone-version:
10+
required: true
11+
type: string
12+
13+
defaults:
14+
run:
15+
working-directory: backend
16+
17+
jobs:
18+
19+
lint:
20+
runs-on: ubuntu-latest
21+
steps:
22+
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Install the latest version of uv
27+
uses: astral-sh/setup-uv@v5
28+
with:
29+
python-version: ${{ inputs.python-version }}
30+
31+
- name: Check formatting
32+
if: ${{ success() || failure() }}
33+
id: ruff-format
34+
run: uvx ruff@latest format --diff
35+
36+
- name: Check lint
37+
if: ${{ success() || failure() }}
38+
id: ruff-lint
39+
run: uvx ruff@latest check --diff
40+
41+
- name: Check XML / ZCML
42+
if: ${{ success() || failure() }}
43+
id: zpretty
44+
run: uvx zpretty@latest --check src
45+
46+
- name: Check Package Metadata
47+
if: ${{ success() || failure() }}
48+
id: pyroma
49+
run: uvx pyroma@latest -d .
50+
51+
- name: Check Python Versions
52+
if: ${{ success() || failure() }}
53+
id: py-versions
54+
run: uvx check-python-versions@latest .
55+
56+
- name: Report
57+
if: ${{ success() || failure() }}
58+
run: |
59+
echo '# Code Analysis' >> $GITHUB_STEP_SUMMARY
60+
echo '| Test | Status |' >> $GITHUB_STEP_SUMMARY
61+
echo '| --- | --- |' >> $GITHUB_STEP_SUMMARY
62+
echo '| Format | ${{ steps.ruff-format.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
63+
echo '| Lint | ${{ steps.ruff-lint.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
64+
echo '| XML / ZCML | ${{ steps.zpretty.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
65+
echo '| Package Metadata | ${{ steps.pyroma.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
66+
echo '| Python Versions | ${{ steps.py-versions.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
67+
68+
test:
69+
runs-on: ubuntu-latest
70+
env:
71+
PYTHON_VERSION: ${{ inputs.python-version }}
72+
PLONE_VERSION: ${{ inputs.plone-version }}
73+
steps:
74+
75+
- name: Checkout
76+
uses: actions/checkout@v4
77+
78+
- name: Install the latest version of uv
79+
uses: astral-sh/setup-uv@v5
80+
with:
81+
python-version: ${{ inputs.python-version }}
82+
enable-cache: false
83+
84+
- name: Restore uv cache
85+
uses: actions/cache@v4
86+
with:
87+
path: ${{ env.UV_CACHE_DIR }}
88+
key: uv-${{ runner.os }}-${{ inputs.python-version }}-${{ inputs.plone-version }}-${{ hashFiles('pyproject.toml') }}
89+
restore-keys: |
90+
uv-${{ runner.os }}-${{ inputs.python-version }}-${{ inputs.plone-version }}-${{ hashFiles('pyproject.toml') }}
91+
uv-${{ runner.os }}-${{ inputs.python-version }}-${{ inputs.plone-version }}
92+
93+
- name: Install Plone and package
94+
run: make install
95+
96+
- name: Run tests
97+
run: make test
98+
99+
coverage:
100+
runs-on: ubuntu-latest
101+
needs:
102+
- test
103+
steps:
104+
- name: Checkout
105+
uses: actions/checkout@v4
106+
107+
- name: Install the latest version of uv
108+
uses: astral-sh/setup-uv@v5
109+
with:
110+
python-version: ${{ inputs.python-version }}
111+
enable-cache: false
112+
113+
- name: Restore uv cache
114+
uses: actions/cache@v4
115+
with:
116+
path: /tmp/.uv-cache
117+
key: uv-${{ runner.os }}-${{ inputs.python-version }}-${{ inputs.plone-version }}-${{ hashFiles('pyproject.toml') }}
118+
restore-keys: |
119+
uv-${{ runner.os }}-${{ inputs.python-version }}-${{ inputs.plone-version }}-${{ hashFiles('pyproject.toml') }}
120+
uv-${{ runner.os }}-${{ inputs.python-version }}-${{ inputs.plone-version }}
121+
122+
- name: Install Plone and package
123+
run: make install
124+
125+
- name: Run tests
126+
run: make test-coverage
127+
128+
- name: Report Coverage
129+
run: |
130+
echo "# Coverage Report" >> $GITHUB_STEP_SUMMARY
131+
echo "$(uv run coverage report --format markdown)" >> $GITHUB_STEP_SUMMARY

.github/workflows/frontend.yml

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
name: Frontend CI
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
base-tag:
7+
required: true
8+
type: string
9+
image-name-prefix:
10+
required: true
11+
type: string
12+
image-name-suffix:
13+
required: true
14+
type: string
15+
node-version:
16+
required: true
17+
type: string
18+
volto-version:
19+
required: true
20+
type: string
21+
22+
defaults:
23+
run:
24+
working-directory: ./frontend
25+
26+
jobs:
27+
code-analysis:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout codebase
31+
uses: actions/checkout@v4
32+
33+
- name: Use Node.js ${{ inputs.node-version }}
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: ${{ inputs.node-version }}
37+
38+
- name: Enable corepack
39+
run: |
40+
npm i -g corepack@latest
41+
corepack enable
42+
43+
- name: Get pnpm store directory
44+
shell: bash
45+
run: |
46+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
47+
48+
- uses: actions/cache@v4
49+
name: Setup pnpm cache
50+
with:
51+
path: ${{ env.STORE_PATH }}
52+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
53+
restore-keys: |
54+
${{ runner.os }}-pnpm-store-
55+
56+
- name: Install dependencies
57+
run: make install
58+
59+
- name: Linting
60+
id: lint
61+
if: ${{ success() || failure() }}
62+
run: make lint
63+
64+
- name: i18n sync
65+
id: i18n
66+
if: ${{ success() || failure() }}
67+
run: make ci-i18n
68+
69+
- name: Unit Tests
70+
id: unit
71+
if: ${{ success() || failure() }}
72+
run: make test
73+
74+
- name: Report
75+
if: ${{ success() || failure() }}
76+
run: |
77+
echo '# Code Analysis' >> $GITHUB_STEP_SUMMARY
78+
echo '| Test | Status |' >> $GITHUB_STEP_SUMMARY
79+
echo '| --- | --- |' >> $GITHUB_STEP_SUMMARY
80+
echo '| Lint | ${{ steps.lint.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
81+
echo '| i18n | ${{ steps.i18n.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
82+
echo '| Unit Tests | ${{ steps.unit.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY
83+
84+
release:
85+
runs-on: ubuntu-latest
86+
needs:
87+
- code-analysis
88+
permissions:
89+
contents: read
90+
packages: write
91+
92+
steps:
93+
94+
- name: Checkout
95+
uses: actions/checkout@v4
96+
97+
- name: Docker meta
98+
id: meta
99+
uses: docker/metadata-action@v5
100+
with:
101+
images: |
102+
${{ inputs.image-name-prefix }}-${{ inputs.image-name-suffix }}
103+
labels: |
104+
org.label-schema.docker.cmd=docker run -d -p 8080:8080 ${{ inputs.image-name-prefix }}-${{ inputs.image-name-suffix }}:${{ inputs.base-tag }}
105+
flavor:
106+
latest=false
107+
tags: |
108+
type=ref,event=branch
109+
type=sha
110+
type=raw,value=latest,enable={{is_default_branch}}
111+
112+
- name: Set up QEMU
113+
uses: docker/setup-qemu-action@v3
114+
115+
- name: Set up Docker Buildx
116+
uses: docker/setup-buildx-action@v3
117+
118+
- name: Login to Container Registry
119+
uses: docker/login-action@v3
120+
with:
121+
registry: ghcr.io
122+
username: ${{ github.actor }}
123+
password: ${{ secrets.GITHUB_TOKEN }}
124+
125+
- name: Build and push
126+
uses: docker/build-push-action@v5
127+
with:
128+
platforms: linux/amd64
129+
context: frontend/
130+
file: frontend/Dockerfile
131+
push: ${{ github.event_name != 'pull_request' }}
132+
tags: ${{ steps.meta.outputs.tags }}
133+
labels: ${{ steps.meta.outputs.labels }}
134+
build-args: |
135+
VOLTO_VERSION=${{ inputs.volto-version }}

0 commit comments

Comments
 (0)