Skip to content

fix: php 8.4 nullable types for moved modules + cloudinary v3 upgrade #4117

fix: php 8.4 nullable types for moved modules + cloudinary v3 upgrade

fix: php 8.4 nullable types for moved modules + cloudinary v3 upgrade #4117

Workflow file for this run

name: Test
on:
push:
branches:
- '**'
workflow_dispatch:
inputs:
turborepo_caching:
description: 'Turborepo caching'
type: choice
options:
- 'On'
- 'Off'
default: 'On'
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Init check
if: github.repository != 'amazeeio-solutions/silverback-template'
run:
echo 'Please run the INIT script. See the root README.md for
instructions.' && false
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup
uses: ./.github/actions/setup
- name: TurboRepo local server
if: github.event.inputs.turborepo_caching != 'Off'
uses: felixmosh/turborepo-gh-artifacts@v3
with:
server-token: 'local'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check if Drupal content export is up to date
run: |
set -ex
cd apps/cms
pnpm turbo prep
pnpm content:export
if [[ $(git status --porcelain web/modules/custom/test_content) ]]; then
echo "Error: Content export is not up to date"
echo "Please run 'pnpm content:export' from apps/cms and commit the changes"
echo "Detected changes:"
git status --porcelain web/modules/custom/test_content
echo "Diff:"
git diff web/modules/custom/test_content
exit 1
fi
env:
TURBO_API: 'http://127.0.0.1:9080'
TURBO_TOKEN: 'local'
TURBO_TEAM: 'local'
- name: Precommit to catch early errors
run: pnpm precommit
env:
TURBO_API: 'http://127.0.0.1:9080'
TURBO_TOKEN: 'local'
TURBO_TEAM: 'local'
- name: Verify precommit did not change anything
run: |
set -ex
if [[ $(git status --porcelain .) ]]; then
echo "Error: Formatting changes found. Run 'pnpm precommit' before committing"
echo "Detected changes:"
git status --porcelain .
echo "Diff:"
git diff .
exit 1
fi
- name: Test
run: pnpm turbo:test
env:
TURBO_API: 'http://127.0.0.1:9080'
TURBO_TOKEN: 'local'
TURBO_TEAM: 'local'
- name: 'Logs: cms'
run: cat /tmp/cms.log || true
if: always()
- name: 'Logs: website'
run: cat /tmp/website.log || true
if: always()
- name: 'Logs: preview'
run: cat /tmp/preview.log || true
if: always()
- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: tests/e2e/playwright-report/
retention-days: 3
- name: Check for Chromatic project token
id: chromatic-check
shell: bash
run: |
if [ "${{ secrets.CHROMATIC_PROJECT_TOKEN }}" != '' ]; then
echo "available=true" >> $GITHUB_OUTPUT;
else
echo "available=false" >> $GITHUB_OUTPUT;
fi
- name: Publish to Chromatic
uses: chromaui/action@v11
with:
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
storybookBuildDir: packages/ui/storybook-static
storybookBaseDir: packages/ui
onlyChanged: true
exitOnceUploaded: true
externals: |
static/stories/webforms/**
if:
${{ steps.chromatic-check.outputs.available == 'true' &&
github.ref != 'refs/heads/dev' }}
- name: Deploy storybook to netlify
run:
pnpm run --filter=@custom/ui build && pnpm --package=netlify-cli dlx
netlify deploy --prod --filter @custom/ui
--dir=packages/ui/storybook-static
env:
VITEST_CLOUDINARY_CLOUDNAME: local
NETLIFY_SITE_ID: ${{ vars.NETLIFY_STORYBOOK_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
if:
${{ github.ref == 'refs/heads/dev' && vars.NETLIFY_STORYBOOK_ID != ''
}}
update_dashboard:
name: Update dashboard
if: github.ref == 'refs/heads/release' && vars.JIRA_PROJECT_ID != ''
runs-on: ubuntu-latest
steps:
- name: Install estimator
run: npm install -g @amazeelabs/estimator
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update dashboard
env:
JIRA_PROJECT_ID: ${{ vars.JIRA_PROJECT_ID }}
DASHBOARD_ACCESS_TOKEN: ${{ secrets.DASHBOARD_ACCESS_TOKEN }}
run: amazeelabs-estimator update
init_script:
name: Init script
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup
uses: ./.github/actions/setup
- name: TurboRepo local server
if: ${{ github.event.inputs.turborepo_caching != 'Off' }}
uses: felixmosh/turborepo-gh-artifacts@v3
with:
server-token: 'local'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Test init script
run:
pnpm --filter @custom/init run init --project-human-name "Foo Bar"
--project-machine-name foo_bar | grep 'Run `pnpm i` to update the lock
file'
- name: Run "pnpm i" to ensure all packages are linked
id: package_check
run: |
set +e
output=$(pnpm i --no-frozen-lockfile 2>&1)
exit_code=$?
echo "$output"
if echo "$output" | grep -q "is not in the npm registry"; then
echo "Looks like a new @amazeelabs package was added in this PR. Skipping the package link check."
echo "should_skip_test=true" >> $GITHUB_OUTPUT
exit 0
fi
exit $exit_code
- name: Run tests (for "test-all/" branches)
if: >-
(startsWith(github.ref_name, 'test-all/') ||
startsWith(github.head_ref, 'test-all/')) &&
steps.package_check.outputs.should_skip_test != 'true'
run: pnpm turbo:test
env:
TURBO_API: 'http://127.0.0.1:9080'
TURBO_TOKEN: 'local'
TURBO_TEAM: 'local'
docker_build:
name: Docker Build
if: >-
startsWith(github.ref_name, 'test-all/') || startsWith(github.head_ref,
'test-all/')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Install Pygmy
run: |
set -ex
brew tap pygmystack/pygmy
brew install pygmy
- name: Start Pygmy
run: pygmy up
- name: Docker Build & Up
run: DOCKER_BUILDKIT=1 docker compose up -d --build
- name: Wait a bit
run: sleep 5
- name: Verify all services are running
run: |
set -eu
expected=$(docker compose config --services | sort)
actual=$(docker compose ps --services --filter "status=running" | sort)
echo "Declared services: $expected"
echo "Running services: $actual"
missing=$(comm -23 <(echo "$expected") <(echo "$actual") | tr '\n' ' ')
if [ -n "$missing" ]; then
echo "❌ Missing or exited services: $missing"
echo
echo "🛠 Showing logs for the bad ones:"
docker compose logs --tail 50 $missing || true
exit 1
fi
echo "✅ All services are up"