Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
cfranklin11 committed Jul 17, 2024
1 parent c7b465c commit f19ed2b
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 35 deletions.
83 changes: 49 additions & 34 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,49 @@ name: build
on: push

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hoverkraft-tech/compose-action@v2.0.1
with:
compose-file: "docker-compose.ci.yml"
# test:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: hoverkraft-tech/compose-action@v2.0.1
# with:
# compose-file: "docker-compose.ci.yml"

- name: Check client types
run: docker-compose -f docker-compose.ci.yml exec -T client yarn run typecheck
- name: Lint client Typescript files
run: docker-compose -f docker-compose.ci.yml exec -T client yarn run lint
# - name: Check client types
# run: docker-compose -f docker-compose.ci.yml exec -T client yarn run typecheck
# - name: Lint client Typescript files
# run: docker-compose -f docker-compose.ci.yml exec -T client yarn run lint

- name: Check server types
run: docker-compose -f docker-compose.ci.yml exec -T server yarn run typecheck
- name: Lint server Typescript files
run: docker-compose -f docker-compose.ci.yml exec -T server yarn run lint
# - name: Check server types
# run: docker-compose -f docker-compose.ci.yml exec -T server yarn run typecheck
# - name: Lint server Typescript files
# run: docker-compose -f docker-compose.ci.yml exec -T server yarn run lint

- name: Run server unit tests
run: docker-compose -f docker-compose.ci.yml exec -T server yarn run test:unit
- name: Run client unit tests
run: docker-compose -f docker-compose.ci.yml exec -T client yarn run test --watchAll=false
- name: Run server integration tests
run: ./scripts/integration_tests.sh
- name: Run browser end to end tests for client app
id: e2e
run: ./scripts/browser_tests.sh
- uses: actions/upload-artifact@v4
if: ${{ failure() && steps.e2e.outcome == 'failure' }}
with:
name: e2e-screenshots
path: browser_test/cypress/screenshots/
# - name: Run server unit tests
# run: docker-compose -f docker-compose.ci.yml exec -T server yarn run test:unit
# - name: Run client unit tests
# run: docker-compose -f docker-compose.ci.yml exec -T client yarn run test --watchAll=false
# - name: Run server integration tests
# run: ./scripts/integration_tests.sh
# - name: Run browser end to end tests for client app
# id: e2e
# run: ./scripts/browser_tests.sh
# - uses: actions/upload-artifact@v4
# if: ${{ failure() && steps.e2e.outcome == 'failure' }}
# with:
# name: e2e-screenshots
# path: browser_test/cypress/screenshots/

next:
runs-on: ubuntu-latest
env:
DB_NAME: test
DATABASE_URL: postgresql://root@localhost:26257/test?sslmode=disable
steps:
- uses: actions/checkout@v4
- uses: hoverkraft-tech/compose-action@v2.0.1
with:
services: db
compose-file: "docker-compose.ci.yml"
- uses: actions/setup-node@v4
with:
node-version: "22"
Expand All @@ -54,13 +57,25 @@ jobs:
- name: Check types
if: ${{ always() }}
run: npm run typecheck
- uses: hoverkraft-tech/compose-action@v2.0.1
with:
services: db
compose-file: "docker-compose.ci.yml"
- name: Unit tests
run: npm run test
- name: Check status
run: |
docker-compose -f docker-compose.ci.yml ps
docker-compose -f docker-compose.ci.yml logs
- name: Run e2e tests
id: e2e
run: npm run test:ci

- name: Check status again
if: ${{ always() }}
run: |
docker-compose -f docker-compose.ci.yml ps
docker-compose -f docker-compose.ci.yml logs
- name: Check tables
if: ${{ always() }}
run: docker-compose -f docker-compose.ci.yml exec -T db cockroach sql --insecure -d test -e "SELECT * FROM information_schema.tables WHERE table_schema = 'public'"
- uses: actions/upload-artifact@v4
if: ${{ failure() && steps.e2e.outcome == 'failure' }}
with:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"test:ci": "run-s test:setup test:e2e",
"test:cypress": "cypress run -b chrome",
"test:e2e": "start-server-and-test dev http://localhost:3000 test:cypress",
"test:setup": "prisma migrate reset -f",
"test:setup": "prisma db push --accept-data-loss",
"typecheck": "tsc"
},
"dependencies": {
Expand Down

0 comments on commit f19ed2b

Please sign in to comment.