Skip to content

feat: upgrade design system to 73.10.0 and integrate with figure component #6294

feat: upgrade design system to 73.10.0 and integrate with figure component

feat: upgrade design system to 73.10.0 and integrate with figure component #6294

Workflow file for this run

---
name: CI
on: # yamllint disable-line rule:truthy
push:
branches: [main, 'release/v*']
pull_request:
branches: [main, 'release/v*']
concurrency:
group: '${{ github.head_ref || github.ref }}-${{ github.workflow }}'
cancel-in-progress: true
env:
POETRY_VERSION: '2.4.1' # keep in sync with pyproject.toml, Dockerfile
COVERAGE_CORE: 'sysmon'
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: 'false'
- name: Install Poetry
run: pipx install poetry==${{ env.POETRY_VERSION }}
- name: Get cache flags
id: cache-flag
uses: ./.github/actions/setup-cache-flag
- name: Set up Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 # zizmor: ignore[cache-poisoning]
with:
python-version-file: .python-version
cache: ${{ steps.cache-flag.outputs.poetry-cache }} # disabled on release branches via setup-cache-flag action
- name: Check poetry lock file version
run: make check-poetry-version
- name: Install dependencies
run: poetry install --no-root
- name: Install gettext
run: sudo apt-get install -y gettext
- name: Makemessages check
run: make makemessages-check
- name: Lint Python
run: make lint-py
- name: Lint HTML
run: make lint-html
lint-front-end:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: 'false'
- name: Get cache flags
id: cache-flag
uses: ./.github/actions/setup-cache-flag
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 # zizmor: ignore[cache-poisoning]
with:
node-version-file: '.nvmrc'
cache: ${{ steps.cache-flag.outputs.npm-cache }} # disabled on release branches via setup-cache-flag action
- id: node-cache
if: "!contains(github.head_ref || github.ref, 'release')"
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 # zizmor: ignore[cache-poisoning]
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/.nvmrc') }}-${{ hashFiles('**/package-lock.json') }}
lookup-only: false
- if: steps.node-cache.outputs.cache-hit != 'true'
run: npm ci --no-audit
- name: CSS linting
run: npm run lint:css
- name: JS linting
run: npm run lint:js
- name: Prettier
run: npm run lint:format
compile-static:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: 'false'
- name: Get cache flags
id: cache-flag
uses: ./.github/actions/setup-cache-flag
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 # zizmor: ignore[cache-poisoning]
with:
node-version-file: '.nvmrc'
cache: ${{ steps.cache-flag.outputs.npm-cache }} # disabled on release branches via setup-cache-flag action
- id: node-cache
if: "!contains(github.head_ref || github.ref, 'release')"
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 # zizmor: ignore[cache-poisoning]
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/.nvmrc') }}-${{ hashFiles('**/package-lock.json') }}
lookup-only: false
- if: steps.node-cache.outputs.cache-hit != 'true'
name: Install npm dependencies
run: npm ci --no-audit
- name: Compile static files
run: npm run build:prod
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: static
path: cms/static_compiled/
test-python:
runs-on: ubuntu-latest
needs: [lint, lint-front-end, compile-static]
env:
DJANGO_SETTINGS_MODULE: cms.settings.test
DATABASE_URL: postgres://postgres:postgres@localhost/postgres # pragma: allowlist secret secretlint-disable-line
ENABLE_DJANGO_DEFENDER: 'false'
POSTGRES_HOST_AUTH_METHOD: trust
SECRET_KEY: fake_secret_key_to_run_tests # pragma: allowlist secret
KAFKA_SERVERS: localhost:9092
services:
postgres:
image: postgres:17
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres # pragma: allowlist secret
POSTGRES_DB: postgres
ports: ['5432:5432']
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
broker:
image: bitnamilegacy/kafka:3.8 # Match Kafka version in production
env:
# Enable plaintext connections for local testing.
ALLOW_PLAINTEXT_LISTENER: 'yes'
# Enable KRaft mode (no ZooKeeper).
KAFKA_ENABLE_KRAFT: 'yes'
# Use the KAFKA_CFG_ prefix for Kafka config.
KAFKA_CFG_NODE_ID: '1'
KAFKA_CFG_PROCESS_ROLES: 'broker,controller'
KAFKA_CFG_LISTENERS: 'PLAINTEXT://0.0.0.0:9092,CONTROLLER://0.0.0.0:9093'
KAFKA_CFG_ADVERTISED_LISTENERS: 'PLAINTEXT://localhost:9092'
KAFKA_CFG_CONTROLLER_LISTENER_NAMES: 'CONTROLLER'
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: 'CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT'
KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: '1@localhost:9093'
KAFKA_CFG_OFFSETS_TOPIC_REPLICATION_FACTOR: '1'
KAFKA_CFG_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: '1'
KAFKA_CFG_TRANSACTION_STATE_LOG_MIN_ISR: '1'
KAFKA_CFG_GROUP_INITIAL_REBALANCE_DELAY_MS: '0'
KAFKA_CFG_NUM_PARTITIONS: '3'
# Enable auto-creation of topics
KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE: 'true'
ports: ['9092:9092']
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: 'false'
- name: Install Poetry
run: pipx install poetry==${{ env.POETRY_VERSION }}
- name: Get cache flags
id: cache-flag
uses: ./.github/actions/setup-cache-flag
- name: Set up Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 # zizmor: ignore[cache-poisoning]
with:
python-version-file: .python-version
cache: ${{ steps.cache-flag.outputs.poetry-cache }} # disabled on release branches via setup-cache-flag action
- name: Install dependencies
run: |
poetry install --no-root
sudo apt-get install -y --no-install-recommends gettext cm-super texlive-latex-extra
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: static
path: cms/static_compiled/
- name: Fetch Design System templates
run: make load-design-system-templates
- name: Collect static files
run: poetry run ./manage.py collectstatic --verbosity 0 --noinput --clear
- name: System checks
run: poetry run ./manage.py check
- name: Check for missing migrations
run: poetry run ./manage.py makemigrations --check --noinput
- name: Create cache table
run: poetry run ./manage.py createcachetable
- name: Compile translations
run: make compilemessages
- name: Test
run: make test
- name: Add coverage data to GitHub Action summary
run: |
poetry run coverage html --skip-covered --skip-empty
echo "## Coverage summary" >> "$GITHUB_STEP_SUMMARY"
poetry run coverage report --format=markdown >> "$GITHUB_STEP_SUMMARY"
- name: Upload coverage HTML report
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: html-report
path: htmlcov
- name: Lint Migrations
run: DJANGO_SETTINGS_MODULE=cms.settings.dev make lint-migrations
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: 'false'
- name: Build Docker Image # Verify that the Dockerfile is valid and can build the web image
run: docker build --target web -t ons .
repository_checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: 'false'
- name: Set up Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version-file: .python-version
- name: Ensure .dockerignore (mostly) matches .gitignore
run: ./.github/check_docker_ignore.py
functional-tests:
needs: [lint, lint-front-end, compile-static]
runs-on: ubuntu-latest
strategy:
fail-fast: false # Allow all shards to run even if one fails
matrix:
browser: [chromium]
shard: [1, 2, 3, 4, 5, 6]
env:
TOTAL_SHARDS: 6 # Must match the number of shards in the matrix above
SHUFFLE_SEED: ${{ github.run_id }}
DJANGO_SETTINGS_MODULE: cms.settings.functional_test
SECRET_KEY: fake_secret_key_to_run_tests # pragma: allowlist secret
PLAYWRIGHT_BROWSER: ${{ matrix.browser }}
PLAYWRIGHT_TRACES_DIR: playwright_traces
PLAYWRIGHT_TRACE: 'true'
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: 'false'
- name: Install Poetry
run: pipx install poetry==${{ env.POETRY_VERSION }}
- name: Get cache flags
id: cache-flag
uses: ./.github/actions/setup-cache-flag
- name: Set up Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 # zizmor: ignore[cache-poisoning]
with:
python-version-file: .python-version
cache: ${{ steps.cache-flag.outputs.poetry-cache }} # disabled on release branches via setup-cache-flag action
- name: Install dependencies
run: |
poetry install --no-root
sudo apt-get install -y --no-install-recommends gettext cm-super texlive-latex-extra
- name: Cache Playwright binaries
if: "!contains(github.head_ref || github.ref, 'release')"
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 # zizmor: ignore[cache-poisoning]
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-pw-${{ matrix.browser }}
lookup-only: false
- name: Playwright Install
run: poetry run python -m playwright install --with-deps ${{ matrix.browser }}
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: static
path: cms/static_compiled/
- name: Compile translations
run: make compilemessages
- name: Load Design System templates
run: make load-design-system-templates
- name: Collect static files
run: make collectstatic
- name: Select feature subset
run: |
SHARD_INDEX=${{ matrix.shard }} poetry run python .github/split_functional_test_features.py
- name: Run functional tests
run: |
make functional-tests-up
make functional-tests-list FEATURES="$(paste -sd' ' features.txt)"
make functional-tests-down
- name: Upload failure traces
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: playwright-traces-${{ matrix.browser }}-shard-${{ matrix.shard }}
path: playwright_traces/