Skip to content

First batch of tests #1704

First batch of tests

First batch of tests #1704

Workflow file for this run

name: "kitconcept.intranet: CI"
on:
push:
paths:
- "backend/**"
- "frontend/**"
- ".github/workflows/*.yml"
- "devops/**"
workflow_dispatch:
jobs:
config:
name: "Config: Compute values used in workflow"
uses: ./.github/workflows/config.yml
image-build:
name: "Image: ${{ needs.config.outputs.image-name-prefix }}-${{ matrix.suffix }}:${{ needs.config.outputs.base-tag }}"
uses: ./.github/workflows/image-build.yml
if: ${{ needs.config.outputs.acceptance == 'true' }}
strategy:
fail-fast: false
matrix:
include:
- suffix: "backend"
dockerfile: "Dockerfile"
working-directory: "backend"
build-args: |
IMAGE_TAG=${{ needs.config.outputs.base-tag }}
SEED=${{ github.run_id }}
KC_VERSION=${{ needs.config.outputs.kc-version }}
- suffix: "acceptance"
dockerfile: "Dockerfile.acceptance"
working-directory: "backend"
build-args: |
IMAGE_TAG=${{ needs.config.outputs.base-tag }}
SEED=${{ github.run_id }}
KC_VERSION=${{ needs.config.outputs.kc-version }}
- suffix: "frontend"
dockerfile: "Dockerfile"
working-directory: "frontend"
build-args: |
VOLTO_VERSION=${{ needs.config.outputs.volto-version }}
needs:
- config
with:
base-tag: ${{ needs.config.outputs.base-tag }}
image-name-prefix: ${{ needs.config.outputs.image-name-prefix }}
image-name-suffix: ${{ matrix.suffix }}
build-args: ${{ matrix.build-args }}
dockerfile: ${{ matrix.dockerfile }}
working-directory: ${{ matrix.working-directory }}
backend:
uses: ./.github/workflows/backend.yml
needs:
- config
with:
python-version: ${{ needs.config.outputs.python-version }}
kc-version: ${{ needs.config.outputs.kc-version }}
if: ${{ needs.config.outputs.backend == 'true' }}
permissions:
contents: read
packages: write
frontend:
uses: ./.github/workflows/frontend.yml
needs:
- config
with:
node-version: ${{ needs.config.outputs.node-version }}
volto-version: ${{ needs.config.outputs.volto-version }}
if: ${{ needs.config.outputs.frontend == 'true' }}
permissions:
contents: read
packages: write
acceptance:
name: "Acceptance: ${{ matrix.name }}"
uses: ./.github/workflows/acceptance.yml
if: ${{ needs.config.outputs.acceptance == 'true' }}
strategy:
fail-fast: false
matrix:
include:
- name: "Core Tests - Basic"
spec-pattern: 'core/basic/*.cy.{js,jsx,ts,tsx}'
- name: "Core Tests - Blocks"
spec-pattern: 'core/blocks/*.cy.{js,jsx,ts,tsx}'
- name: "Core Tests - Listings"
spec-pattern: 'core/blocks-listings/*.cy.{js,jsx,ts,tsx}'
- name: "Core Tests - Content"
spec-pattern: 'core/content/*.cy.{js,jsx,ts,tsx}'
- name: "Main Tests"
spec-pattern: 'main/**/*.cy.{js,jsx,ts,tsx}'
needs:
- config
- image-build
with:
base-tag: ${{ needs.config.outputs.base-tag }}
node-version: ${{ needs.config.outputs.node-version }}
name: ${{ matrix.name }}
spec-pattern: ${{ matrix.spec-pattern }}
a11y:
name: "A11y: ${{ matrix.name }}"
uses: ./.github/workflows/acceptance.yml
if: ${{ needs.config.outputs.acceptance == 'true' }}
strategy:
fail-fast: false
matrix:
include:
- name: "Tests"
api-url: 'localhost:8080/plone'
spec-pattern: 'a11y/**/*.cy.{js,jsx,ts,tsx}'
needs:
- config
- image-build
with:
base-tag: ${{ needs.config.outputs.base-tag }}
node-version: ${{ needs.config.outputs.node-version }}
name: ${{ matrix.name }}
api-url: ${{ matrix.api-url }}
spec-pattern: ${{ matrix.spec-pattern }}
test-profile: a11y
backend-release:
uses: ./.github/workflows/backend-release.yml
needs:
- config
- acceptance
- a11y
- backend
with:
base-tag: ${{ needs.config.outputs.base-tag }}
image-name-prefix: ${{ needs.config.outputs.image-name-prefix }}
image-name-suffix: "backend"
python-version: ${{ needs.config.outputs.python-version }}
kc-version: ${{ needs.config.outputs.kc-version }}
if: ${{ needs.config.outputs.deploy == 'true' && (always() && !contains(needs.*.result, 'failure')) }}
permissions:
contents: read
packages: write
frontend-release:
uses: ./.github/workflows/frontend-release.yml
needs:
- config
- acceptance
- a11y
- frontend
with:
base-tag: ${{ needs.config.outputs.base-tag }}
image-name-prefix: ${{ needs.config.outputs.image-name-prefix }}
image-name-suffix: "frontend"
node-version: ${{ needs.config.outputs.node-version }}
volto-version: ${{ needs.config.outputs.volto-version }}
if: ${{ needs.config.outputs.deploy == 'true' && (always() && !contains(needs.*.result, 'failure')) }}
permissions:
contents: read
packages: write
deploy:
name: "Deploy: plone-intranet.kitconcept.dev"
uses: kitconcept/meta/.github/workflows/deploy.yml@scale-after
if: ${{ always() && github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && !contains(needs.*.result, 'failure') }}
needs:
- config
- backend-release
- frontend-release
with:
tag: ${{ needs.config.outputs.base-tag }}
environment: "plone-intranet.kitconcept.dev"
stack-name: "plone-intranet-kitconcept-dev"
stack-file: "devops/stacks/demo.yml"
registry: "ghcr.io"
username: ${{ github.actor }}
scale-after: "plone-intranet-kitconcept-dev_solr-reindex=1"
secrets:
password: ${{ secrets.DEPLOY_GHCR_READ_TOKEN }}
remote-host: ${{ secrets.DEPLOY_HOST }}
remote-port: ${{ secrets.DEPLOY_PORT }}
remote-user: ${{ secrets.DEPLOY_USER }}
remote-private-key: ${{ secrets.DEPLOY_SSH }}
env-file: |
IMAGE_NAME_PREFIX=${{ needs.config.outputs.image-name-prefix }}
IMAGE_TAG=${{ needs.config.outputs.base-tag }}
STACK_NAME=${{ vars.STACK_NAME }}
STACK_PREFIX=${{ vars.STACK_PREFIX }}
HOSTNAME=${{ vars.HOSTNAME }}
CERTRESOLVER=${{ vars.CERTRESOLVER }}
permissions:
contents: read
packages: write
report:
name: "Final report"
if: ${{ always() }}
runs-on: ubuntu-latest
needs:
- config
- image-build
- acceptance
- a11y
- backend
- frontend
- deploy
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 '| image-build | ${{ needs.image-build.result }} |' >> $GITHUB_STEP_SUMMARY
echo '| acceptance | ${{ needs.acceptance.result }} |' >> $GITHUB_STEP_SUMMARY
echo '| a11y | ${{ needs.a11y.result }} |' >> $GITHUB_STEP_SUMMARY
echo '| backend | ${{ needs.backend.result }} |' >> $GITHUB_STEP_SUMMARY
echo '| frontend | ${{ needs.frontend.result }} |' >> $GITHUB_STEP_SUMMARY
echo '| deploy | ${{ needs.deploy.result }} |' >> $GITHUB_STEP_SUMMARY