Skip to content

more plonecli compat #352

more plonecli compat

more plonecli compat #352

Workflow file for this run

name: "Cookieplone Templates: CI"
description: "Main workflow for cookieplone-templates"
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
env:
node-version: 22.x
node-version-prerelease: 24.x
python-version: "3.10"
jobs:
report-keys:
name: "Report keys usage"
uses: ./.github/workflows/report.yml
with:
python-version: "3.13"
test-repository:
name: "Test repository settings: ${{ matrix.python-version }}"
uses: ./.github/workflows/test-repository.yml
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
with:
python-version: ${{ matrix.python-version }}
test-template:
name: "Test template"
if: "${{ always() }}"
needs:
- test-repository
uses: ./.github/workflows/test-template.yml
strategy:
fail-fast: false
matrix:
include:
- name: "project"
path: "templates/projects/monorepo"
- name: "classic_project"
path: "templates/projects/classic"
- name: "backend_addon"
path: "templates/add-ons/backend"
- name: "frontend_addon"
path: "templates/add-ons/frontend"
- name: "sub/cache"
path: "templates/sub/cache"
- name: "sub/frontend_project"
path: "templates/sub/frontend_project"
- name: "sub/project_settings"
path: "templates/sub/project_settings"
with:
name: ${{ matrix.name }}
tests-path: ${{ matrix.path }}
backend-functional:
runs-on: ubuntu-latest
if: "${{ always() }}"
needs:
- test-repository
env:
template: "backend_addon"
name: "collective.addon"
steps:
- name: Checkout codebase
uses: actions/checkout@v4
- name: Generate
uses: ./.github/actions/generate
with:
template: ${{ env.template }}
python-version: ${{ env.python-version }}
- name: Restore uv cache
uses: actions/cache@v4
with:
path: ${{ env.UV_CACHE_DIR }}
key: uv-${{ runner.os }}-${{ env.python-version }}-${{ hashFiles( 'templates/add-ons/backend/collective.addon/pyproject.toml') }}
restore-keys: |
uv-${{ runner.os }}-${{ env.python-version }}-${{ hashFiles('templates/add-ons/backend/collective.addon/pyproject.toml') }}
uv-${{ runner.os }}-${{ env.python-version }}
- name: Install generated package
working-directory: ${{ env.name }}
run: |
make install
- name: Run unit tests
working-directory: ${{ env.name }}
run: |
make test
frontend-functional:
runs-on: ubuntu-latest
if: "${{ always() }}"
needs:
- test-repository
env:
template: "frontend_addon"
name: "volto-add-on"
steps:
- name: Checkout codebase
uses: actions/checkout@v4
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}
- name: Generate
uses: ./.github/actions/generate
with:
template: ${{ env.template }}
python-version: ${{ env.python-version }}
- name: Enable corepack
run: |
npm install -g --force corepack@latest
corepack enable
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('volto-add-on/pnpm-lock.yaml', 'volto-add-on/package.json','volto-add-on/mrs.developer.json') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Cache Cypress Binary
id: cache-cypress-binary
uses: actions/cache@v4
with:
path: ~/.cache/Cypress
key: Cypress-binary-${{ env.node-version }}-${{ hashFiles('volto-add-on/pnpm-lock.yaml', 'volto-add-on/package.json','volto-add-on/mrs.developer.json') }}
- name: Install generated package
working-directory: ${{ env.name }}
run: |
make install
- name: Install Cypress if not in cache
if: steps.cache-cypress-binary.outputs.cache-hit != 'true'
working-directory: ${{ env.name }}
shell: bash
run: 'NODEBIN=$(pnpm bin) && $NODEBIN/cypress install'
- name: Run unit tests
working-directory: ${{ env.name }}
run: |
make ci-test
- name: Run i18n tests
working-directory: ${{ env.name }}
run: |
make i18n
- name: Run linting
working-directory: ${{ env.name }}
run: |
make lint
- name: Run formatting
working-directory: ${{ env.name }}
run: |
make format
- name: Run Storybook
working-directory: ${{ env.name }}
run: |
make storybook-build
- name: Start Servers
uses: JarvusInnovations/background-action@v1
with:
working-directory: ${{ env.name }}
run: |
make ci-acceptance-backend-start &
make acceptance-frontend-prod-start &
# your step-level and job-level environment variables are available to your commands as-is
# npm install will count towards the wait-for timeout
# whenever possible, move unrelated scripts to a different step
# to background multiple processes: add & to the end of the command
wait-on: |
http-get://localhost:55001/plone
http://localhost:3000
# IMPORTANT: to use environment variables in wait-on, you must use this form: ${{ env.VAR }}
# See wait-on section below for all resource types and prefixes
tail: true # true = stderr,stdout
# This will allow you to monitor the progress live
log-output-resume: stderr
# Eliminates previosuly output stderr log entries from post-run output
wait-for: 10m
log-output: stderr,stdout # same as true
log-output-if: failure
- name: Run acceptance tests
working-directory: ${{ env.name }}
run: |
make ci-acceptance-test
frontend-functional-prerelease:
runs-on: ubuntu-latest
if: "${{ always() }}"
needs:
- test-repository
env:
template: "frontend_addon"
name: "volto-add-on"
steps:
- name: Checkout codebase
uses: actions/checkout@v4
- name: Use Node.js ${{ env.node-version-prerelease }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version-prerelease }}
- name: Generate
uses: ./.github/actions/generate
with:
template: ${{ env.template }}
python-version: ${{ env.python-version }}
frontend-use-prerelease-versions: 'Yes'
- name: Enable corepack
run: |
npm install -g --force corepack@latest
corepack enable
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('volto-add-on/package.json','volto-add-on/mrs.developer.json') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Cache Cypress Binary
id: cache-cypress-binary
uses: actions/cache@v4
with:
path: ~/.cache/Cypress
key: Cypress-binary-${{ env.node-version }}-${{ hashFiles('volto-add-on/pnpm-lock.yaml', 'volto-add-on/package.json','volto-add-on/mrs.developer.json') }}
- name: Install generated package
working-directory: ${{ env.name }}
run: |
make install
- name: Install Cypress if not in cache
if: steps.cache-cypress-binary.outputs.cache-hit != 'true'
working-directory: ${{ env.name }}
shell: bash
run: 'NODEBIN=$(pnpm bin) && $NODEBIN/cypress install'
- name: Run unit tests
working-directory: ${{ env.name }}
run: |
make ci-test
- name: Run i18n tests
working-directory: ${{ env.name }}
run: |
make i18n
- name: Run linting
working-directory: ${{ env.name }}
run: |
make lint
- name: Run formatting
working-directory: ${{ env.name }}
run: |
make format
- name: Run Storybook
working-directory: ${{ env.name }}
run: |
make storybook-build
- name: Start Servers
uses: JarvusInnovations/background-action@v1
with:
working-directory: ${{ env.name }}
run: |
make ci-acceptance-backend-start &
make acceptance-frontend-prod-start &
# your step-level and job-level environment variables are available to your commands as-is
# npm install will count towards the wait-for timeout
# whenever possible, move unrelated scripts to a different step
# to background multiple processes: add & to the end of the command
wait-on: |
http-get://localhost:55001/plone
http://localhost:3000
# IMPORTANT: to use environment variables in wait-on, you must use this form: ${{ env.VAR }}
# See wait-on section below for all resource types and prefixes
tail: true # true = stderr,stdout
# This will allow you to monitor the progress live
log-output-resume: stderr
# Eliminates previosuly output stderr log entries from post-run output
wait-for: 10m
log-output: stderr,stdout # same as true
log-output-if: failure
- name: Run acceptance tests
working-directory: ${{ env.name }}
run: |
make ci-acceptance-test
report:
runs-on: ubuntu-latest
needs:
- report-keys
- test-repository
- test-template
- backend-functional
- frontend-functional
steps:
- name: Report
shell: bash
run: |
echo '# Report' >> $GITHUB_STEP_SUMMARY
echo '| Job | Status |' >> $GITHUB_STEP_SUMMARY
echo '| --- | --- |' >> $GITHUB_STEP_SUMMARY
echo '| Keys usage | ✅ |' >> $GITHUB_STEP_SUMMARY
echo '| Repository Tests | ✅ |' >> $GITHUB_STEP_SUMMARY
echo '| Template Generation | ✅ |' >> $GITHUB_STEP_SUMMARY
echo '| Functional: Backend add-on | ✅ |' >> $GITHUB_STEP_SUMMARY
echo '| Functional: Frontend add-on | ✅ |' >> $GITHUB_STEP_SUMMARY