- **build fix** - **fix for multiple errors with ESmodule** <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Chores** - Streamlined the continuous integration process with improved dependency caching, a new build step, and updated configuration for a more reliable release flow. - Modernized TypeScript settings to enhance module handling and overall build consistency. - **Tests** - Updated test configurations for improved ECMAScript module support and more precise test discovery. - Introduced new commands for executing tests, watching test changes, linting, and type checking to boost quality assurance. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
60 lines
1.2 KiB
YAML
60 lines
1.2 KiB
YAML
name: CF-API CI
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- 'js/cf-api/**'
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
validate:
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: read
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
registry-url: https://npm.pkg.github.com
|
|
scope: '@codeflash-ai'
|
|
cache: 'npm'
|
|
cache-dependency-path: 'js/cf-api/package-lock.json'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
cd js/cf-api
|
|
npm ci
|
|
|
|
- name: Run tests
|
|
run: |
|
|
cd js/cf-api
|
|
NODE_OPTIONS=--experimental-vm-modules npx jest --ci --config jest.config.cjs
|
|
|
|
- name: Build
|
|
run: |
|
|
cd js/cf-api
|
|
npm run build
|
|
|
|
# - name: Type check
|
|
# run: |
|
|
# cd js/cf-api
|
|
# npx tsc --noEmit
|
|
#
|
|
# - name: Lint
|
|
# run: |
|
|
# cd js/cf-api
|
|
# npx eslint . --ext .ts,.mjs
|
|
|
|
|