Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions .github/workflows/frontend-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,16 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install pnpm with npm
run: npm install -g pnpm
uses: actions/checkout@v4

- uses: actions/setup-node@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
node-version-file: .nvmrc
cache: pnpm
bun-version: 1.3.2

- name: Install dependencies with pnpm
run: pnpm install
- name: Install dependencies
run: bun install

- name: Verify Build
working-directory: ./packages/frontend-main
run: pnpm build
run: bun run build
17 changes: 7 additions & 10 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,15 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install pnpm with npm
run: npm install -g pnpm

- uses: actions/setup-node@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
node-version-file: .nvmrc
cache: pnpm
bun-version: 1.3.2

- name: Install dependencies with pnpm
run: pnpm install
- name: Install dependencies
run: bun install

- name: Lint
run: pnpm run lint
run: bun run lint
18 changes: 10 additions & 8 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,31 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.2

- name: Set up Node.js for NPM publish
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org/'
scope: '@atomone'

- name: Install pnpm
run: npm install -g pnpm
scope: '@dither.chat'

- name: Install dependencies
run: |
cd ./packages/${{ github.event.inputs.package }}
pnpm install
bun install

- name: Build package
run: |
cd ./packages/${{ github.event.inputs.package }}
pnpm run build
bun run build

- name: Publish to NPM
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
cd ./packages/${{ github.event.inputs.package }}
pnpm publish --access public --no-git-checks
bun publish --access public --no-git-checks
21 changes: 7 additions & 14 deletions .github/workflows/smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install pnpm with npm
run: npm install -g pnpm

- uses: actions/setup-node@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
node-version-file: .nvmrc
cache: pnpm

- name: Install dependencies with pnpm
run: pnpm install
bun-version: 1.3.2

- name: Build dependencies
working-directory: packages/api-main
run: pnpm run build:deps
- name: Install dependencies
run: bun install

- name: Run tests
working-directory: packages/api-main
run: pnpm run test:smoke
run: bun run test:smoke
env:
APP_NAME: ${{ inputs.app_name }}

Expand Down
23 changes: 8 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,25 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install pnpm with npm
run: npm install -g pnpm

- uses: actions/setup-node@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
node-version-file: .nvmrc
cache: pnpm

- name: Install dependencies with pnpm
run: pnpm install
bun-version: 1.3.2

- name: Build dependencies
working-directory: packages/api-main
run: pnpm build:deps
- name: Install dependencies
run: bun install

- name: Setup database schema
working-directory: packages/api-main
run: pnpm db:push:force
run: bun run db:push:force
env:
PG_URI: postgresql://default:password@localhost:5432/postgres

- name: Run tests
working-directory: packages/api-main
run: pnpm test
run: bun run test
env:
NODE_OPTIONS: --experimental-global-webcrypto
PG_URI: postgresql://default:password@localhost:5432/postgres
Expand Down
45 changes: 25 additions & 20 deletions .github/workflows/testnet-api-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,43 +32,48 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install pnpm with npm
run: npm install -g pnpm
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.2

- name: Create Directory
run: mkdir -p ./packages/api-main/data/postgres_data

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm

- name: Install dependencies with pnpm
run: pnpm install
- name: Install dependencies
run: bun install

- name: Set up Docker
uses: docker/setup-docker-action@v4

- name: Build API Types
working-directory: ./packages/lib-api-types
run: pnpm build

- name: Run Docker Compose Up
working-directory: ./packages/api-main
run: docker compose -f ./docker-compose-github.yml up --build -d --wait --wait-timeout 30

- name: Push database migrations
- name: Wait for database to be ready
working-directory: ./packages/api-main
run: |
cp .env.example .env
pnpm db:push:force
until docker exec postgres_db pg_isready -U default; do
sleep 1
done

- name: Push database migrations
working-directory: ./packages/api-main
run: bun run db:push:force
env:
PG_URI: postgresql://default:password@localhost:5432/postgres

- name: Run tests with pnpm
- name: Run tests
working-directory: ./packages/api-main
run: pnpm test
run: bun run test
env:
NODE_OPTIONS: --experimental-global-webcrypto
PG_URI: postgresql://default:password@localhost:5432/postgres
JWT: default_jwt_secret
JWT_STRICTNESS: lax
AUTH: whatever

build:
needs: [detect-changes, test]
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pnpm lint-staged
bunx lint-staged
8 changes: 4 additions & 4 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ docker_build('ditherchat/api-main', '.',
dockerfile = './packages/api-main/Dockerfile',
live_update = [
sync('./packages/api-main/src', '/app'),
run('pnpm install', trigger='package.json'),
run('bun install', trigger='package.json'),
restart_container(),
])

docker_build('ditherchat/reader-main', '.',
dockerfile = './packages/reader-main/Dockerfile',
live_update = [
sync('./packages/reader-main/src', '/app'),
run('pnpm install', trigger='package.json'),
run('bun install', trigger='package.json'),
restart_container(),
])

local_resource(
name='frontend-main',
dir='./packages/frontend-main',
cmd='pnpm install',
serve_cmd='cd ./packages/frontend-main && pnpm run dev',
cmd='bun install',
serve_cmd='cd ./packages/frontend-main && bun run dev',
resource_deps=['api-main'],
deps=[
'./packages/frontend-main/src',
Expand Down
Loading