diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 00000000..c05971d1 --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,43 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Setup Node.js environment + uses: actions/setup-node@v1.4.2 + + - name: Install npm dependencies + run: npm ci + + - name: Unit tests + run: npm run test + + - name: Setup PostgreSQL + uses: Harmon758/postgresql-action@v1.0.0 + with: + postgresql db: vrt_db_dev + postgresql user: postgres + postgresql password: postgres + + - name: Wait untill DB started (workaround of https://github.com/Harmon758/postgresql-action/issues/7) + uses: jakejarvis/wait-action@v0.1.0 + with: + time: '5s' + + - name: Apply DB migrations + run: npx prisma migrate up -c --experimental + + - name: Run e2e tests + run: npm run test:e2e