Skip to content

Commit dbd6695

Browse files
committed
Initial commit
0 parents  commit dbd6695

File tree

174 files changed

+36089
-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.

174 files changed

+36089
-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 Configurtaion 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

.github/workflows/backend.yml

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
name: Backend CI
2+
3+
on:
4+
push:
5+
paths:
6+
- "backend/**"
7+
- ".github/workflows/backend.yml"
8+
workflow_dispatch:
9+
10+
env:
11+
IMAGE_NAME_PREFIX: ghcr.io/rafahela/ploneconf2024
12+
IMAGE_NAME_SUFFIX: backend
13+
PYTHON_VERSION: "3.11"
14+
15+
jobs:
16+
17+
meta:
18+
runs-on: ubuntu-latest
19+
outputs:
20+
PLONE_VERSION: ${{ steps.vars.outputs.PLONE_VERSION }}
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Set Env Vars
26+
id: vars
27+
run: |
28+
echo "PLONE_VERSION=$(cat backend/version.txt)" >> $GITHUB_OUTPUT
29+
30+
black:
31+
runs-on: ubuntu-latest
32+
needs:
33+
- meta
34+
steps:
35+
- name: Checkout codebase
36+
uses: actions/checkout@v4
37+
38+
- name: Run check
39+
uses: plone/code-analysis-action@v2
40+
with:
41+
base_dir: 'backend'
42+
check: 'black'
43+
44+
flake8:
45+
runs-on: ubuntu-latest
46+
needs:
47+
- meta
48+
steps:
49+
- name: Checkout codebase
50+
uses: actions/checkout@v4
51+
52+
- name: Run check
53+
uses: plone/code-analysis-action@v2
54+
with:
55+
base_dir: 'backend'
56+
check: 'flake8'
57+
58+
isort:
59+
runs-on: ubuntu-latest
60+
needs:
61+
- meta
62+
steps:
63+
- name: Checkout codebase
64+
uses: actions/checkout@v4
65+
66+
- name: Run check
67+
uses: plone/code-analysis-action@v2
68+
with:
69+
base_dir: 'backend'
70+
check: 'isort'
71+
72+
zpretty:
73+
runs-on: ubuntu-latest
74+
needs:
75+
- meta
76+
steps:
77+
- name: Checkout codebase
78+
uses: actions/checkout@v4
79+
80+
- name: Run check
81+
uses: plone/code-analysis-action@v2
82+
with:
83+
base_dir: 'backend'
84+
check: 'zpretty'
85+
86+
tests:
87+
runs-on: ubuntu-latest
88+
needs:
89+
- meta
90+
defaults:
91+
run:
92+
working-directory: ./backend
93+
94+
steps:
95+
- uses: actions/checkout@v4
96+
97+
- name: Setup Plone ${{ needs.meta.outputs.PLONE_VERSION }} with Python ${{ env.PYTHON_VERSION }}
98+
uses: plone/[email protected]
99+
with:
100+
python-version: ${{ env.PYTHON_VERSION }}
101+
plone-version: ${{ needs.meta.outputs.PLONE_VERSION }}
102+
103+
- name: Install package
104+
run: |
105+
pip install mxdev
106+
mxdev -c mx.ini
107+
pip install -r requirements-mxdev.txt
108+
109+
- name: Run tests
110+
run: |
111+
pytest --disable-warnings tests
112+
113+
release:
114+
runs-on: ubuntu-latest
115+
needs:
116+
- meta
117+
- black
118+
- flake8
119+
- isort
120+
- zpretty
121+
- tests
122+
permissions:
123+
contents: read
124+
packages: write
125+
126+
steps:
127+
128+
- name: Checkout
129+
uses: actions/checkout@v4
130+
131+
- name: Docker meta
132+
id: meta
133+
uses: docker/metadata-action@v5
134+
with:
135+
images: |
136+
${{ env.IMAGE_NAME_PREFIX }}-${{ env.IMAGE_NAME_SUFFIX }}
137+
labels: |
138+
org.label-schema.docker.cmd=docker run -d -p 8080:8080 ${{ env.IMAGE_NAME_PREFIX }}-${{ env.IMAGE_NAME_SUFFIX }}:latest
139+
flavor:
140+
latest=false
141+
tags: |
142+
type=ref,event=branch
143+
type=sha
144+
type=raw,value=latest,enable={{is_default_branch}}
145+
146+
- name: Set up QEMU
147+
uses: docker/setup-qemu-action@v3
148+
149+
- name: Set up Docker Buildx
150+
uses: docker/setup-buildx-action@v3
151+
152+
- name: Login to Container Registry
153+
uses: docker/login-action@v3
154+
with:
155+
registry: ghcr.io
156+
username: ${{ github.actor }}
157+
password: ${{ secrets.GITHUB_TOKEN }}
158+
159+
- name: Build and push
160+
uses: docker/build-push-action@v5
161+
with:
162+
platforms: linux/amd64
163+
context: backend
164+
file: backend/Dockerfile
165+
push: ${{ github.event_name != 'pull_request' }}
166+
tags: ${{ steps.meta.outputs.tags }}
167+
labels: ${{ steps.meta.outputs.labels }}
168+
build-args: |
169+
PLONE_VERSION=${{ needs.meta.outputs.PLONE_VERSION }}

.github/workflows/frontend.yml

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

0 commit comments

Comments
 (0)