Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ jobs:
coverage:
name: "Backend: Coverage"
uses: plone/meta/.github/workflows/backend-pytest-coverage.yml@2.x
needs:
- test
with:
python-version: ${{ inputs.python-version }}
plone-version: ${{ inputs.plone-version }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
repository: ${{ steps.filter.outputs.repository }}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- uses: dorny/paths-filter@v3.0.2
id: filter
Expand All @@ -43,7 +43,7 @@ jobs:
needs:
- config
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
# Fetch all history
fetch-depth: '0'
Expand All @@ -69,7 +69,7 @@ jobs:
run:
working-directory: ./frontend
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
# Fetch all history
fetch-depth: '0'
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
needs:
- config
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
# Fetch all history
fetch-depth: '0'
Expand Down
45 changes: 27 additions & 18 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ name: "Compute Config variables"
on:
workflow_call:
inputs:
image-name-prefix:
required: false
type: string
default: "ghcr.io/plonegovbr/social-media"
node-version:
required: false
type: string
Expand Down Expand Up @@ -36,7 +32,7 @@ on:
value: ${{ jobs.config.outputs.base-tag }}
image-name-prefix:
description: "Image name prefix for container images"
value: ${{ inputs.image-name-prefix }}
value: ${{ jobs.config.outputs.image-name-prefix }}
node-version:
description: "Node version to be used"
value: ${{ inputs.node-version }}
Expand All @@ -60,20 +56,29 @@ jobs:
docs: ${{ steps.filter.outputs.docs }}
frontend: ${{ steps.filter.outputs.frontend }}
base-tag: ${{ steps.vars.outputs.base-tag }}
image-name-prefix: ${{ steps.vars.outputs.image-name-prefix }}
plone-version: ${{ steps.vars.outputs.plone-version }}
volto-version: ${{ steps.vars.outputs.volto-version }}

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup uv
uses: plone/meta/.github/actions/setup_uv@2.x
with:
python-version: ${{ inputs.python-version }}
working-directory: '.'

- name: Compute several vars needed for the CI
id: vars
shell: bash
run: |
echo "base-tag=sha-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "plone-version=$(cat backend/version.txt)" >> $GITHUB_OUTPUT
python3 -c 'import json; data = json.load(open("./frontend/mrs.developer.json")); print("volto-version=" + (data["core"].get("tag") or "latest"))' >> $GITHUB_OUTPUT
REPOSITORY_SETTINGS="$(uvx repoplone settings dump)"
echo "image-name-prefix=$(jq -r '.container_images_prefix' <<< "$REPOSITORY_SETTINGS")" >> "$GITHUB_OUTPUT"
echo "plone-version=$(jq -r '.backend.base_package_version' <<< "$REPOSITORY_SETTINGS")" >> "$GITHUB_OUTPUT"
echo "volto-version=$(jq -r '.frontend.volto_version' <<< "$REPOSITORY_SETTINGS")" >> "$GITHUB_OUTPUT"
echo "base-tag=sha-$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"

- uses: dorny/paths-filter@v3.0.2
id: filter
Expand All @@ -99,12 +104,16 @@ jobs:

- name: Test vars
run: |
echo "base-tag: ${{ steps.vars.outputs.base-tag }}"
echo 'plone-version: ${{ steps.vars.outputs.plone-version }}'
echo 'volto-version: ${{ steps.vars.outputs.volto-version }}'
echo 'event-name: ${{ github.event_name }}'
echo 'Paths - acceptance: ${{ steps.filter.outputs.acceptance }}'
echo 'Paths - backend: ${{ steps.filter.outputs.backend }}'
echo 'Paths - devops: ${{ steps.filter.outputs.devops }}'
echo 'Paths - docs: ${{ steps.filter.outputs.docs }}'
echo 'Paths - frontend: ${{ steps.filter.outputs.frontend }}'
echo '# Config Settings' >> $GITHUB_STEP_SUMMARY
echo '| Variable | Value |' >> $GITHUB_STEP_SUMMARY
echo '| --- | --- |' >> $GITHUB_STEP_SUMMARY
echo "| base-tag | ${{ steps.vars.outputs.base-tag }} |" >> $GITHUB_STEP_SUMMARY
echo "| plone-version | ${{ steps.vars.outputs.plone-version }} |" >> $GITHUB_STEP_SUMMARY
echo "| volto-version | ${{ steps.vars.outputs.volto-version }} |" >> $GITHUB_STEP_SUMMARY
echo "| image-name-prefix | ${{ steps.vars.outputs.image-name-prefix }} |" >> $GITHUB_STEP_SUMMARY
echo "| event-name | ${{ github.event_name }} |" >> $GITHUB_STEP_SUMMARY
echo "| acceptance | ${{ steps.filter.outputs.acceptance }} |" >> $GITHUB_STEP_SUMMARY
echo "| backend | ${{ steps.filter.outputs.backend }} |" >> $GITHUB_STEP_SUMMARY
echo "| devops | ${{ steps.filter.outputs.devops }} |" >> $GITHUB_STEP_SUMMARY
echo "| docs | ${{ steps.filter.outputs.docs }} |" >> $GITHUB_STEP_SUMMARY
echo "| frontend | ${{ steps.filter.outputs.frontend }} |" >> $GITHUB_STEP_SUMMARY
26 changes: 22 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ on:
paths:
- "backend/**"
- "frontend/**"
- ".github/workflows/backend.yml"
- ".github/workflows/docs.yml"
- ".github/workflows/frontend.yml"
- ".github/workflows/main.yml"
- ".github/workflows/*.yml"
- "devops/**"
- "docs/**"
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -53,3 +51,23 @@ jobs:
permissions:
contents: read
packages: write

report:
name: "Final report"
if: ${{ always() }}
runs-on: ubuntu-latest
needs:
- config
- backend
- frontend
- docs
steps:
- name: Write report
run: |
echo '# Workflow Report' >> $GITHUB_STEP_SUMMARY
echo '| Job ID | Conclusion |' >> $GITHUB_STEP_SUMMARY
echo '| --- | --- |' >> $GITHUB_STEP_SUMMARY
echo '| config | ${{ needs.config.result }} |' >> $GITHUB_STEP_SUMMARY
echo '| backend | ${{ needs.backend.result }} |' >> $GITHUB_STEP_SUMMARY
echo '| docs | ${{ needs.docs.result }} |' >> $GITHUB_STEP_SUMMARY
echo '| frontend | ${{ needs.frontend.result }} |' >> $GITHUB_STEP_SUMMARY
21 changes: 15 additions & 6 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
{
"recommendations": [
"charliermarsh.ruff",
"ms-python.python",
"redhat.vscode-yaml"
]
}
"recommendations": [
"charliermarsh.ruff",
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"ExecutableBookProject.myst-highlight",
"github.vscode-github-actions",
"ms-python.python",
"ms-azuretools.vscode-containers",
"ms-vscode-remote.remote-containers",
"redhat.vscode-yaml",
"stylelint.vscode-stylelint",
"plone.plone-vs-utilities"
]
}
15 changes: 13 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
{
"eslint.workingDirectories": ["./frontend"],
"flake8.cwd": "${workspaceFolder}/backend",
"flake8.args": ["--config=pyproject.toml"],
"files.encoding": "utf8",
"stylelint.enable": true,
"css.validate": false,
"less.validate": false,
"scss.validate": false,
"ruff.organizeImports": true,
"python.terminal.activateEnvironment": true,
"python.testing.pytestArgs": [
"backend/tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"[css][less][scss]": {
"editor.tabSize": 2,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.stylelint": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.formatOnSave": false
}
Expand Down
Loading