mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-09 15:07:55 -05:00
* added initial code for versioning * ran migrations & improvements to versioning * change sensitivity of state diff checker * debounce the change detection function * cleaned up file structure * added ci job to run migrations when merging to main * ran migrations * cleanup unused files, remove unused dependencies
76 lines
1.8 KiB
YAML
76 lines
1.8 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
test:
|
|
name: Test and Build
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
cache-dependency-path: './sim/package-lock.json'
|
|
|
|
- name: Install dependencies
|
|
working-directory: ./sim
|
|
run: npm ci
|
|
|
|
- name: Fix Rollup module issue
|
|
working-directory: ./sim
|
|
run: |
|
|
rm -rf node_modules package-lock.json
|
|
npm install
|
|
|
|
- name: Run tests with coverage
|
|
working-directory: ./sim
|
|
env:
|
|
NODE_OPTIONS: "--no-warnings"
|
|
run: npm run test:coverage
|
|
|
|
- name: Build application
|
|
working-directory: ./sim
|
|
run: npm run build
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
directory: ./sim/coverage
|
|
fail_ci_if_error: false
|
|
verbose: true
|
|
|
|
migrations:
|
|
name: Apply Database Migrations
|
|
runs-on: ubuntu-latest
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
needs: test
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
cache-dependency-path: './sim/package-lock.json'
|
|
|
|
- name: Install dependencies
|
|
working-directory: ./sim
|
|
run: npm ci
|
|
|
|
- name: Apply migrations
|
|
working-directory: ./sim
|
|
env:
|
|
POSTGRES_URL: ${{ secrets.DATABASE_URL }}
|
|
run: npx drizzle-kit push |