Skip to content

feat: adjust testimonial content max-height based on page context and count #1464

feat: adjust testimonial content max-height based on page context and count

feat: adjust testimonial content max-height based on page context and count #1464

Workflow file for this run

name: Code Quality
on:
pull_request:
types: [synchronize, opened, reopened]
push:
branches:
- main
# Set minimum permissions by default
permissions:
contents: read
jobs:
docker-lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Lint Dockerfile
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: Dockerfile
security-scan:
runs-on: ubuntu-latest
timeout-minutes: 15
# Specify permissions needed for this job
permissions:
security-events: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
load: true
tags: apostrophe-cms:test
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Run Docker Scout scan
uses: docker/scout-action@v1
with:
command: cves
image: apostrophe-cms:test
sarif-file: docker-scan-results.sarif
only-severities: critical,high
- name: Upload scan results
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: docker-scan-results.sarif
category: docker-scout
unit-tests:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Create coverage directory
run: mkdir -p website/coverage
- name: Build app image
run: >-
docker compose -f docker-compose.yml -f docker-compose.override.yml build
- name: Run tests
run: >-
docker compose -f docker-compose.yml -f docker-compose.override.yml
run --rm apostrophe npm run test -- --coverage
- name: Save coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: website/coverage/lcov.info
lint:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build app image
run: >-
docker compose -f docker-compose.yml -f docker-compose.override.yml build
- name: Run lint
run: >-
docker compose -f docker-compose.yml -f docker-compose.override.yml
run --rm apostrophe npm run lint
e2e-tests:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download Playwright snapshots artifact
uses: actions/download-artifact@v4
with:
name: playwright-snapshots
path: e2e-snapshots-main
merge-multiple: true
github-token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
continue-on-error: true
- name: Ensure report directories exist
run: |
mkdir -p e2e-snapshots-main
mkdir -p e2e-snapshots-results
mkdir -p e2e-test-results
ls -la e2e-snapshots-results
ls -la e2e-test-results
ls -la e2e-snapshots-main
- name: Start Apostrophe
run: docker compose up -d
- name: Wait for Apostrophe to start
run: sleep 30
- name: Run Playwright tests
run: |
set -e
docker compose -f docker-compose.e2e.yml run --rm \
--name apostrophe-playwright-test \
--build \
--entrypoint "npm run test:e2e -c playwright.config.js" \
playwright-test || true
continue-on-error: true
- name: Upload snapshots as new artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: e2e-snapshots-results
retention-days: 20
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-test-results
path: e2e-test-results
retention-days: 20
- name: Stop and remove all Docker Compose containers
if: always()
run: |
docker compose down -v
sonarqube:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' && vars.SONAR_DISABLE_CI != 'true' }}
needs: unit-tests
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download coverage report
uses: actions/download-artifact@v4
with:
name: coverage-report
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@v5.0.0
with:
args: >
-Dsonar.verbose=true
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.organization=speedandfunction
-Dsonar.projectKey=speedandfunction_website
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
-Dsonar.pullrequest.branch=${{ github.head_ref }}
-Dsonar.pullrequest.base=${{ github.base_ref }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: SonarQube Quality Gate check
uses: sonarsource/sonarqube-quality-gate-action@v1.1.0
timeout-minutes: 5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}