Skip to content

Update npm: SWC

Update npm: SWC #1649

Workflow file for this run

name: CI
on:
push:
branches:
- renovate/*
- main
pull_request:
branches:
- main
workflow_call:
inputs:
version:
description: The version to set in the package.json files
default: "0.0.0"
required: false
type: string
branch_name:
description: The name of the branch
required: true
type: string
env:
NODE_VERSION: 22
defaults:
run:
shell: pwsh
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: tobysmith568/actions/.github/actions/checkout-pnpm-project@main
with:
ref: ${{ inputs.branch_name }}
node-version: ${{ env.NODE_VERSION }}
- name: Run ESLint
run: pnpm run lint
- name: Run Prettier
run: pnpm prettier --check .
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: tobysmith568/actions/.github/actions/checkout-pnpm-project@main
with:
ref: ${{ inputs.branch_name }}
node-version: ${{ env.NODE_VERSION }}
- name: Build
run: pnpm nx run-many --target build
- name: Log Version
run: Write-Host ${{ inputs.version }}
- name: Set Version
if: inputs.version != ''
run: pnpm nx run-many --target version --args="--version=${{ inputs.version }}"
- name: Upload Build
uses: actions/upload-artifact@v4
with:
name: build
path: ./dist
retention-days: 1
include-hidden-files: true
test:
name: Unit Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: tobysmith568/actions/.github/actions/checkout-pnpm-project@main
with:
ref: ${{ inputs.branch_name }}
node-version: ${{ env.NODE_VERSION }}
- name: Run Unit Tests
run: pnpm nx run-many --target test --configuration ci
- name: Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
local-licenses:
name: Check Licenses using Build
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: tobysmith568/actions/.github/actions/checkout-pnpm-project@main
with:
ref: ${{ inputs.branch_name }}
node-version: ${{ env.NODE_VERSION }}
- name: Download Build
uses: actions/download-artifact@v4
with:
name: build
path: ./dist
- name: Check licenses
run: node ./dist/packages/license-cop/src/bin/license-cop
published-licenses:
name: Check Licenses using the Published Version
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: tobysmith568/actions/.github/actions/checkout-pnpm-project@main
with:
ref: ${{ inputs.branch_name }}
node-version: ${{ env.NODE_VERSION }}
- name: Check licenses
run: pnpm dlx license-cop
e2e:
name: E2E Test License-Cop
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: tobysmith568/actions/.github/actions/checkout-pnpm-project@main
with:
ref: ${{ inputs.branch_name }}
node-version: ${{ env.NODE_VERSION }}
- name: Install Package Managers
run: corepack enable
- name: Download Build
uses: actions/download-artifact@v4
with:
name: build
path: ./dist
- name: Run E2E Tests
run: pnpm nx run license-cop-e2e:e2e:ci
e2e-website:
name: E2E Test Website
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: tobysmith568/actions/.github/actions/checkout-pnpm-project@main
with:
ref: ${{ inputs.branch_name }}
node-version: ${{ env.NODE_VERSION }}
- name: Download Build
uses: actions/download-artifact@v4
with:
name: build
path: ./dist
- name: Install Cypress
run: pnpm cypress install
- name: Run E2E Tests
run: pnpm start-server-and-test 'pnpm nx run website:serve' http://localhost:4321 'pnpm nx run website-e2e:e2e:ci'