Skip to content

feat(product): transfer in-memory state when hydrating backend (#4148) #3773

feat(product): transfer in-memory state when hydrating backend (#4148)

feat(product): transfer in-memory state when hydrating backend (#4148) #3773

Workflow file for this run

name: Daffodil Build
on:
push:
branches:
- develop
tags: ["v*"]
workflow_call:
inputs:
ref:
required: true
type: string
cache-mode:
required: true
type: string
secrets:
NX_KEY:
required: true
AZURE_STORAGE_CONNECTION_STRING:
required: true
env:
NX_KEY: ${{ secrets.NX_KEY }}
NG_BUILD_ENV: ${{ github.event_name == 'push' && github.ref_type == 'tag' && 'production' || 'next' }}
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
strategy:
matrix:
node: [22.21.x]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ inputs.ref && inputs.ref || github.sha }}
- uses: graycoreio/daffodil/.github/actions/setup-nx-remote-cache@develop
with:
cache-mode: ${{ inputs.cache-mode }}
read-only-azure-connection-string: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}
read-write-azure-connection-string: ${{ secrets.AZURE_NX_CACHE_READWRITE_CONNECTION_STRING }}
event-name: ${{ github.event_name }}
- uses: graycoreio/github-actions/setup-node@main
with:
node-version: ${{ matrix.node }}
use-stamp-cache: true
- run: npx nx run-many -t lint
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
node: [22.21.x]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ inputs.ref && inputs.ref || github.sha }}
- uses: graycoreio/github-actions/setup-node@main
with:
node-version: ${{ matrix.node }}
use-stamp-cache: true
- uses: graycoreio/daffodil/.github/actions/setup-nx-remote-cache@develop
with:
cache-mode: ${{ inputs.cache-mode }}
read-only-azure-connection-string: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}
read-write-azure-connection-string: ${{ secrets.AZURE_NX_CACHE_READWRITE_CONNECTION_STRING }}
event-name: ${{ github.event_name }}
- run: npx nx run-many -t build --parallel=1
- run: cd dist/apps/daffio && zip -r ../daffio.zip .
- uses: actions/upload-artifact@v4
with:
name: daffio-${{ matrix.node }}
path: dist/apps/daffio.zip
if-no-files-found: error
compute_packages:
name: Compute Packages to Test
outputs:
packages: ${{ steps.compute.outputs.packages }}
runs-on: ubuntu-latest
needs: [ ]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref && inputs.ref || github.sha }}
fetch-depth: 0
- uses: graycoreio/github-actions/setup-node@main
with:
node-version: '22.21.x'
use-stamp-cache: true
- uses: nrwl/nx-set-shas@v3
name: Derive appropriate SHAs for base and head for `nx affected` commands
with:
main-branch-name: 'develop'
- name: packages
id: compute
shell: bash
run: |
packages=$(npx nx show projects --affected --json)
echo "packages=$packages" >> ${GITHUB_OUTPUT}
test:
name: Test
runs-on: ubuntu-latest
if: ${{ needs.compute_packages.outputs.packages != '[]' && needs.compute_packages.outputs.packages != '' }}
strategy:
fail-fast: false
matrix:
package: ${{ fromJSON(needs.compute_packages.outputs.packages) }}
node: [22.21.x]
needs:
- compute_packages
- build
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ inputs.ref && inputs.ref || github.sha }}
- uses: graycoreio/daffodil/.github/actions/setup-nx-remote-cache@develop
with:
cache-mode: ${{ inputs.cache-mode }}
read-only-azure-connection-string: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}
read-write-azure-connection-string: ${{ secrets.AZURE_NX_CACHE_READWRITE_CONNECTION_STRING }}
event-name: ${{ github.event_name }}
- uses: graycoreio/github-actions/setup-node@main
with:
node-version: ${{ matrix.node }}
use-stamp-cache: true
- run: npx nx run-many -t test -p ${{ matrix.package }} --parallel=1
name: Test ${{ matrix.package }}
test-commerce-schematic:
name: Test Commerce Schematic
needs:
- build
uses: ./.github/workflows/test-commerce-schematic.yml
with:
ref: ${{ inputs.ref && inputs.ref || github.sha }}
node-versions: '22.21.x'
angular-versions: '^20'
secrets:
NX_KEY: ${{ secrets.NX_KEY }}
AZURE_NX_CACHE_READONLY_CONNECTION_STRING: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING || secrets.AZURE_NX_CACHE_READONLY_CONNECTION_STRING }}
deploy_daffio:
name: Deploy Daff.io
needs:
- build
uses: ./.github/workflows/deploy.yml
if: ${{ github.event_name == 'push' }}
secrets:
VERCEL_NEXT_PROJECT_ID: ${{ secrets.VERCEL_DAFFIO_NEXT_PROJECT_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_DAFFIO_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG: ${{ secrets.VERCEL_ORG }}
with:
artifact: daffio-22.21.x
artifact-zip-name: daffio.zip