Skip to content

feat(driver): remove DaffDriverMagentoModule (#4271) #3641

feat(driver): remove DaffDriverMagentoModule (#4271)

feat(driver): remove DaffDriverMagentoModule (#4271) #3641

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 }}
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 }}
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
publish:
name: Publish
runs-on: ubuntu-latest
if: |
startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push' ||
(github.event_name == 'workflow_call' && startsWith(inputs.ref, 'refs/heads/release-please--branches--'))
needs:
- build
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: graycoreio/github-actions/setup-node@main
with:
node-version: 22.21.x
use-stamp-cache: true
registry-url: 'https://registry.npmjs.org'
- 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
- uses: graycoreio/github-actions/set-versions-from-root@main
- run: npx nx run-many -t publish
if: startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}