Skip to content

Commit

Permalink
fix: build fdr to dist (#587)
Browse files Browse the repository at this point in the history
Co-authored-by: dsinghvi <[email protected]>
  • Loading branch information
abvthecity and dsinghvi authored Mar 28, 2024
1 parent 09245c0 commit f9b4b9c
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 11 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,6 @@ jobs:
pnpm fern generate --local
pnpm turbo --filter=@fern-platform/fdr codegen
- name: Setup database
# TODO: re-enable when moving to turbo
# pnpm turbo --filter= docker:local
run: |
pnpm turbo --filter=@fern-platform/fdr test-db
pnpm turbo --filter=@fern-platform/fdr test-ete
- name: Run tests
run: pnpm test
env:
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/fdr-ete.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Test FDR ETE

on:
push:
paths:
- 'fern/apis/fdr/**'
- 'fern/fern.config.json'
- 'servers/fdr-deploy/**'
- 'servers/fdr/**'
- '.github/workflows/deploy-fdr.yml'
- 'packages/fdr-sdk/**'

env:
PACKAGE_NAME: "@fern-platform/fdr"
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: "buildwithfern"
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2 # This helps turbo resolve changes faster

- name: Install
uses: ./.github/actions/install

- name: Setup database
# TODO: re-enable when moving to turbo
# pnpm turbo --filter= docker:local
run: |
cd servers/fdr
pnpm run docker:local
pnpm run test:ete
1 change: 0 additions & 1 deletion packages/configs/tsconfig/server.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"display": "Server",
"extends": "./base.json",
"compilerOptions": {
"noEmit": true,
"allowJs": true,
"module": "esnext",
"moduleResolution": "bundler",
Expand Down
2 changes: 1 addition & 1 deletion servers/fdr/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ COPY --from=builder /app/out/full/ .
COPY turbo.json turbo.json
COPY shared shared
COPY fern fern
RUN pnpm turbo run build --filter=@fern-platform/fdr
RUN pnpm turbo run compile --filter=@fern-platform/fdr

FROM base AS runner
WORKDIR /app
Expand Down
1 change: 1 addition & 0 deletions servers/fdr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"docker:dev": "dotenv -e .env.dev -- ./create_docker.sh",
"docker:prod": "dotenv -e .env.prod -- ./create_docker.sh",
"test": "vitest src/__test__/unit-tests --globals",
"test:ete": "dotenv -e .env.ete -- ./scripts/ete-tests.sh",
"lint": "eslint --max-warnings 0 src --ext .ts",
"lint:fix": "pnpm lint --fix",
"test-db": "dotenv -e .env.test -- ./scripts/db-tests.sh",
Expand Down
2 changes: 1 addition & 1 deletion servers/fdr/scripts/ete-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cd ..
docker-compose -f docker-compose.ete.yml up -d

echo "Sleeping for 5s..."
sleep 5
sleep 10

pnpm prisma migrate deploy

Expand Down
2 changes: 1 addition & 1 deletion servers/fdr/src/__test__/ete/ete.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ParsedBaseUrl } from "../../util/ParsedBaseUrl";
const PORT = 8080;

// We don't spin up the server in this test.
it.skip("definition register", async () => {
it("definition register", async () => {
// register empty definition
const healthResponse = await axios.get(`http://localhost:${PORT}/health`);
expect(healthResponse.status).toEqual(200);
Expand Down

0 comments on commit f9b4b9c

Please sign in to comment.