Skip to content

Commit

Permalink
feat(slb-457): merge latest release
Browse files Browse the repository at this point in the history
  • Loading branch information
dspachos committed Jan 15, 2025
2 parents bbf5b4b + 2924411 commit cd58890
Show file tree
Hide file tree
Showing 319 changed files with 11,635 additions and 8,252 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

57 changes: 0 additions & 57 deletions .eslintrc.json

This file was deleted.

31 changes: 20 additions & 11 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,38 @@ runs:
uses: jetify-com/[email protected]
with:
enable-cache: 'true'
devbox-version: '0.13.3' # Setting a version is required to make the devbox fully cached.
- name: Load devbox via direnv
uses: HatsuneMiku3939/direnv-action@v1

- name: Check xdebug config
shell: bash
run: |
if ! php --info | grep 'xdebug.mode => develop => develop'; then
if ! php --info | grep 'xdebug.mode => no value => no value'; then
echo 'Error: xdebug.mode should not be set in CI. Have you committed xdebug config by accident? Check devbox.d/php/php.ini'
exit 1
fi
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/cache@v4
name: Setup pnpm cache
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
path: /tmp/cache
key: |
cache-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
cache-${{ hashFiles('**/pnpm-lock.yaml') }}-
cache-
- name: Set composer cache dir
run: composer config --global cache-files-dir /tmp/cache/composer
shell: bash
- name: Set pnpm cache dir
run: pnpm config set store-dir /tmp/cache/pnpm
shell: bash
- name: Set Playwright browsers dir
run:
echo "PLAYWRIGHT_BROWSERS_PATH=/tmp/cache/playwright-browsers" >>
$GITHUB_ENV
shell: bash

- name: Install dependencies
shell: bash
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ on:
- dev

jobs:
test:
deploy:
name: Deploy
if:
(github.ref == 'refs/heads/prod' && vars.NETLIFY_PROD_ID) || (github.ref
== 'refs/heads/dev' && vars.NETLIFY_DEV_ID)
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -60,8 +63,7 @@ jobs:
working-directory: ../deploy
if:
github.ref == 'refs/heads/dev' &&
steps.netlify-check.outputs.available == 'true' && vars.NETLIFY_DEV_ID
!= ''
steps.netlify-check.outputs.available == 'true'
env:
NETLIFY_SITE_ID: ${{ vars.NETLIFY_DEV_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
Expand All @@ -71,8 +73,7 @@ jobs:
working-directory: ../deploy
if:
github.ref == 'refs/heads/prod' &&
steps.netlify-check.outputs.available == 'true' &&
vars.NETLIFY_PROD_ID != ''
steps.netlify-check.outputs.available == 'true'
env:
NETLIFY_SITE_ID: ${{ vars.NETLIFY_PROD_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
87 changes: 87 additions & 0 deletions .github/workflows/fe_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: FE Build

on:
workflow_dispatch:
inputs:
publisher_payload:
description: Publisher payload
required: true
env:
description: Environment
required: true

run-name: 'FE Build [env: ${{ inputs.env }}]'

concurrency:
group: fe_build_${{ inputs.env }}

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Setup
uses: ./.github/actions/setup

- name: TurboRepo local server
uses: felixmosh/turborepo-gh-artifacts@v2
with:
server-token: 'local'
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Publisher
uses: AmazeeLabs/publisher-action@4371b4a90a9fe2c86248e76c0f428e39abf6b610
with:
success_env_var_name: BUILD_IS_SUCCESSFUL
cache_paths: |
apps/website/.cache
apps/website/public
cache_key: 'fe-build-${{ inputs.env }}'

- name: Prepare
run: SKIP_DRUPAL_INSTALL=1 pnpm turbo:prep
env:
TURBO_API: 'http://127.0.0.1:9080'
TURBO_TOKEN: 'local'
TURBO_TEAM: 'local'

- name: Build & deploy
run: |
set -ex
cd apps/website
# Build
if test -d public; then
echo "Single build"
pnpm build:gatsby
else
echo "Double build"
# To mitigate Gatsby bug:
# The first incremental build rewrites compilation hashes even if
# there are no content changes.
pnpm build:gatsby
pnpm build:gatsby
fi
# "netlify deploy" fails to locate edge functions when executed from a
# monorepo. Flags like --cwd or --filter do not help. So we deploy the
# website app to a dedicated folder first.
pnpm deploy --filter "@custom/website" /tmp/deploy --prod
cd /tmp/deploy
# Deploy
pnpm netlify env:set AWS_LAMBDA_JS_RUNTIME nodejs20.x
pnpm netlify env:set DRUPAL_EXTERNAL_URL $DRUPAL_EXTERNAL_URL
pnpm netlify deploy --prodIfUnlocked
# Report success to Publisher
echo "BUILD_IS_SUCCESSFUL=1" >> $GITHUB_ENV
env:
TURBO_API: 'http://127.0.0.1:9080'
TURBO_TOKEN: 'local'
TURBO_TEAM: 'local'
1 change: 1 addition & 0 deletions .github/workflows/merge_dev_to_stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ jobs:
uses: devmasx/[email protected]
with:
type: now
from_branch: dev
target_branch: stage
github_token: ${{ github.token }}
54 changes: 46 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
name: Test
on:
push:
workflow_dispatch:
inputs:
turborepo_caching:
description: 'Turborepo caching'
type: choice
options:
- 'On'
- 'Off'
default: 'On'

jobs:
test:
Expand All @@ -25,6 +34,7 @@ jobs:
run: pnpm test:format

- name: TurboRepo local server
if: ${{ github.event.inputs.turborepo_caching != 'Off' }}
uses: felixmosh/turborepo-gh-artifacts@v2
with:
server-token: 'local'
Expand All @@ -37,6 +47,16 @@ jobs:
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()
Expand Down Expand Up @@ -112,6 +132,22 @@ jobs:
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: 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'

docker_build:
name: Docker Build
if:
Expand All @@ -123,22 +159,24 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2
bundler-cache: true
- name: Install Pygmy
run: gem install pygmy
run: |
set -ex
git clone https://github.com/pygmystack/pygmy.git
cd pygmy
make build
ls -lisa ./builds
cp ./builds/pygmy-linux-amd64 /usr/local/bin/pygmy
chmod +x /usr/local/bin/pygmy
- name: Start Pygmy
run: pygmy up
- name: Docker Build & Up
run: DOCKER_BUILDKIT=1 docker-compose up -d --build
run: DOCKER_BUILDKIT=1 docker compose up -d --build
- name: Wait a bit
run: sleep 5
- name: Check containers status
run: |
if docker-compose ps | grep Exit
if docker compose ps | grep Exit
then
echo "Docker container(s) exited"
exit 1
Expand Down
43 changes: 0 additions & 43 deletions .github/workflows/test_without_turbo_cache.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ dts
apps/website/.env
.DS_Store
.turbo
_local
/_local
Loading

0 comments on commit cd58890

Please sign in to comment.