Skip to content

Commit be77f80

Browse files
committed
Initial commit
0 parents  commit be77f80

File tree

198 files changed

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

198 files changed

+48097
-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: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Backend 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+
python-version:
13+
required: true
14+
type: string
15+
plone-version:
16+
required: true
17+
type: string
18+
kc-version:
19+
required: true
20+
type: string
21+
working-directory:
22+
required: false
23+
type: string
24+
default: backend
25+
26+
defaults:
27+
run:
28+
working-directory: backend
29+
30+
jobs:
31+
32+
lint:
33+
name: "Backend: Lint"
34+
uses: plone/meta/.github/workflows/backend-lint.yml@2.x
35+
with:
36+
python-version: ${{ inputs.python-version }}
37+
plone-version: ${{ inputs.plone-version }}
38+
working-directory: ${{ inputs.working-directory }}
39+
40+
test:
41+
name: "Backend: Test"
42+
uses: plone/meta/.github/workflows/backend-pytest.yml@2.x
43+
with:
44+
python-version: ${{ inputs.python-version }}
45+
plone-version: ${{ inputs.plone-version }}
46+
working-directory: ${{ inputs.working-directory }}
47+
48+
coverage:
49+
name: "Backend: Coverage"
50+
uses: plone/meta/.github/workflows/backend-pytest-coverage.yml@2.x
51+
needs:
52+
- test
53+
with:
54+
python-version: ${{ inputs.python-version }}
55+
plone-version: ${{ inputs.plone-version }}
56+
working-directory: ${{ inputs.working-directory }}
57+
58+
59+
release:
60+
name: "Backend: Build and publish Container Images"
61+
uses: plone/meta/.github/workflows/container-image-build-push.yml@2.x
62+
needs:
63+
- lint
64+
- coverage
65+
strategy:
66+
fail-fast: false
67+
matrix:
68+
include:
69+
- image-name-suffix: "builder"
70+
dockerfile: "Dockerfile.builder"
71+
- image-name-suffix: "prod"
72+
dockerfile: "Dockerfile.prod"
73+
permissions:
74+
contents: read
75+
packages: write
76+
with:
77+
base-tag: ${{ inputs.base-tag }}
78+
image-name-prefix: ${{ inputs.image-name-prefix }}
79+
image-name-suffix: ${{ matrix.image-name-suffix }}
80+
working-directory: ${{ inputs.working-directory }}
81+
dockerfile: ${{ matrix.dockerfile }}
82+
build-args: |
83+
KC_VERSION=${{ inputs.kc-version }}
84+
push: ${{ github.event_name != 'pull_request' }}
85+
secrets:
86+
username: ${{ github.actor }}
87+
password: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/changelog.yml

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
name: Changelog
2+
on:
3+
pull_request:
4+
types: [assigned, opened, synchronize, reopened, labeled, unlabeled]
5+
branches:
6+
- main
7+
8+
env:
9+
NODE_VERSION: 22.x
10+
ADDON_NAME: core
11+
BASE_BRANCH: main
12+
13+
jobs:
14+
config:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
backend: ${{ steps.filter.outputs.backend }}
18+
frontend: ${{ steps.filter.outputs.frontend }}
19+
repository: ${{ steps.filter.outputs.repository }}
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- uses: dorny/paths-filter@v3.0.2
25+
id: filter
26+
with:
27+
filters: |
28+
backend:
29+
- 'backend/**'
30+
repository:
31+
- '.github/**'
32+
- '.vscode/**'
33+
- 'devops/**'
34+
- 'docs/**'
35+
- 'docker-compose.yml'
36+
- 'README.md'
37+
frontend:
38+
- 'frontend/**'
39+
40+
backend:
41+
if: ${{ needs.config.outputs.backend == 'true' }}
42+
runs-on: ubuntu-latest
43+
needs:
44+
- config
45+
steps:
46+
- uses: actions/checkout@v4
47+
with:
48+
# Fetch all history
49+
fetch-depth: '0'
50+
51+
- name: Install pipx
52+
run: pip install towncrier
53+
54+
- name: Check for presence of a Change Log fragment (only pull requests)
55+
if: github.event_name == 'pull_request'
56+
run: |
57+
# Fetch the pull request' base branch so towncrier will be able to
58+
# compare the current branch with the base branch.
59+
# Source: https://github.com/actions/checkout/#fetch-all-branches.
60+
git fetch --no-tags origin ${BASE_BRANCH}
61+
towncrier check --compare-with origin/${{ env.BASE_BRANCH }} --config backend/pyproject.toml --dir backend/
62+
63+
frontend:
64+
if: ${{ needs.config.outputs.frontend == 'true' }}
65+
runs-on: ubuntu-latest
66+
needs:
67+
- config
68+
defaults:
69+
run:
70+
working-directory: ./frontend
71+
steps:
72+
- uses: actions/checkout@v4
73+
with:
74+
# Fetch all history
75+
fetch-depth: '0'
76+
77+
- name: Install pipx
78+
run: pip install towncrier
79+
80+
- name: Use Node.js ${{ env.NODE_VERSION }}
81+
uses: actions/setup-node@v4
82+
with:
83+
node-version: ${{ env.NODE_VERSION }}
84+
85+
- name: Enable corepack
86+
run: npm i -g corepack@latest && corepack enable
87+
88+
- name: Get pnpm store directory
89+
shell: bash
90+
run: |
91+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
92+
93+
- uses: actions/cache@v4
94+
name: Setup pnpm cache
95+
with:
96+
path: ${{ env.STORE_PATH }}
97+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
98+
restore-keys: |
99+
${{ runner.os }}-pnpm-store-
100+
101+
- name: Install dependencies
102+
run: make install
103+
104+
- name: Check for presence of a Change Log fragment (only pull requests)
105+
if: github.event_name == 'pull_request'
106+
run: |
107+
# Fetch the pull request' base branch so towncrier will be able to
108+
# compare the current branch with the base branch.
109+
# Source: https://github.com/actions/checkout/#fetch-all-branches.
110+
git fetch --no-tags origin ${BASE_BRANCH}
111+
cd ..
112+
towncrier check --compare-with origin/${{ env.BASE_BRANCH }} --config frontend/packages/${{ env.ADDON_NAME }}/towncrier.toml --dir frontend/packages/${{ env.ADDON_NAME }}
113+
114+
repository:
115+
if: ${{ needs.config.outputs.repository == 'true' }}
116+
runs-on: ubuntu-latest
117+
needs:
118+
- config
119+
steps:
120+
- uses: actions/checkout@v4
121+
with:
122+
# Fetch all history
123+
fetch-depth: '0'
124+
125+
- name: Install pipx
126+
run: pip install towncrier
127+
128+
- name: Check for presence of a Change Log fragment (only pull requests)
129+
if: github.event_name == 'pull_request'
130+
run: |
131+
# Fetch the pull request' base branch so towncrier will be able to
132+
# compare the current branch with the base branch.
133+
# Source: https://github.com/actions/checkout/#fetch-all-branches.
134+
git fetch --no-tags origin ${BASE_BRANCH}
135+
towncrier check --compare-with origin/${{ env.BASE_BRANCH }} --config towncrier.toml --dir .

.github/workflows/config.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: 'Configurações'
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
image-name-prefix:
7+
required: false
8+
type: string
9+
default: "ghcr.io/kitconcept/core"
10+
node-version:
11+
required: false
12+
type: string
13+
default: "22.x"
14+
python-version:
15+
required: false
16+
type: string
17+
default: "3.12"
18+
outputs:
19+
backend:
20+
description: "Flag reporting if we should run the backend jobs"
21+
value: ${{ jobs.config.outputs.backend }}
22+
docs:
23+
description: "Flag reporting if we should run the docs jobs"
24+
value: ${{ jobs.config.outputs.docs }}
25+
frontend:
26+
description: "Flag reporting if we should run the frontend jobs"
27+
value: ${{ jobs.config.outputs.frontend }}
28+
base-tag:
29+
description: "Base tag to be used when creating container images"
30+
value: ${{ jobs.config.outputs.base-tag }}
31+
image-name-prefix:
32+
description: "Image name prefix for container images"
33+
value: ${{ inputs.image-name-prefix }}
34+
node-version:
35+
description: "Node version to be used"
36+
value: ${{ inputs.node-version }}
37+
python-version:
38+
description: "Python version to be used"
39+
value: ${{ inputs.python-version }}
40+
plone-version:
41+
description: "Plone version to be used"
42+
value: ${{ jobs.config.outputs.plone-version }}
43+
kc-version:
44+
description: "kitconcept.core version to be used"
45+
value: ${{ jobs.config.outputs.kc-version }}
46+
volto-version:
47+
description: "Volto version to be used"
48+
value: ${{ jobs.config.outputs.volto-version }}
49+
50+
jobs:
51+
config:
52+
runs-on: ubuntu-latest
53+
outputs:
54+
backend: ${{ steps.filter.outputs.backend }}
55+
base-tag: ${{ steps.vars.outputs.base-tag }}
56+
docs: ${{ steps.filter.outputs.docs }}
57+
frontend: ${{ steps.filter.outputs.frontend }}
58+
image-name-prefix: ${{ inputs.image-name-prefix }}
59+
node-version: ${{ inputs.node-version }}
60+
kc-version: ${{ steps.vars.outputs.kc-version }}
61+
plone-version: ${{ steps.vars.outputs.plone-version }}
62+
python-version: ${{ inputs.python-version }}
63+
volto-version: ${{ steps.vars.outputs.volto-version }}
64+
65+
steps:
66+
- name: Checkout
67+
uses: actions/checkout@v4
68+
69+
- name: Compute several vars needed for the CI
70+
id: vars
71+
run: |
72+
echo "base-tag=sha-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
73+
echo "kc-version=$(cat version.txt)" >> $GITHUB_OUTPUT
74+
echo "plone-version=$(cat backend/version.txt)" >> $GITHUB_OUTPUT
75+
python3 -c 'import json; data = json.load(open("./frontend/mrs.developer.json")); print("volto-version=" + (data["core"].get("tag") or "latest"))' >> $GITHUB_OUTPUT
76+
77+
- uses: dorny/paths-filter@v3
78+
id: filter
79+
with:
80+
filters: |
81+
backend:
82+
- 'backend/**'
83+
- '.github/workflows/backend.yml'
84+
docs:
85+
- 'docs/**'
86+
- 'README.md'
87+
- '.github/workflows/docs.yml'
88+
frontend:
89+
- 'frontend/**'
90+
- '.github/workflows/frontend.yml'
91+
92+
- name: Test vars
93+
run: |
94+
echo 'backend=${{ steps.filter.outputs.backend }}'
95+
echo 'base-tag=${{ steps.vars.outputs.base-tag }}'
96+
echo 'docs=${{ steps.filter.outputs.docs }}'
97+
echo 'frontend=${{ steps.filter.outputs.frontend }}'
98+
echo 'image-name-prefix=${{ inputs.image-name-prefix }}'
99+
echo 'node-version=${{ inputs.node-version }}'
100+
echo 'kc-version=${{ steps.vars.outputs.kc-version }}'
101+
echo 'plone-version=${{ steps.vars.outputs.plone-version }}'
102+
echo 'python-version=${{ inputs.python-version }}'
103+
echo 'volto-version=${{ steps.vars.outputs.volto-version }}'

.github/workflows/docs.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: "Build documentation, check links, spelling, grammar, and style"
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
python-version:
7+
required: true
8+
type: string
9+
working-directory:
10+
required: false
11+
type: string
12+
default: docs
13+
14+
jobs:
15+
docs:
16+
name: "Docs: Build"
17+
uses: plone/meta/.github/workflows/docs-build.yml@2.x
18+
with:
19+
python-version: ${{ inputs.python-version }}
20+
working-directory: ${{ inputs.working-directory }}
21+
check-vale: true

0 commit comments

Comments
 (0)