From 21225a157ee979dd4aa8b14017563442312a0523 Mon Sep 17 00:00:00 2001 From: Pavel Strunkin Date: Wed, 27 May 2020 18:54:56 +0200 Subject: [PATCH 1/5] Create workflow.yml --- .github/workflows/workflow.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/workflow.yml diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 00000000..787b3ce2 --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,33 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - name: Setup Node.js environment + uses: actions/setup-node@v1.4.2 + + - name: Install npm dependencies + run: npm ci + + - name: Install npm dependencies + run: npm run test + From 9ddb41457f20999bed7352b19cc6eb909fa779c4 Mon Sep 17 00:00:00 2001 From: Pavel Strunkin Date: Wed, 27 May 2020 19:09:54 +0200 Subject: [PATCH 2/5] Update workflow.yml --- .github/workflows/workflow.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 787b3ce2..ca4ff277 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -28,6 +28,15 @@ jobs: - name: Install npm dependencies run: npm ci - - name: Install npm dependencies + - 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: Apply DB migrations + run: npx prisma migrate up -c --experimental From 9f35f2b21bc8c14ff2cb4ff674752d41d70a73ee Mon Sep 17 00:00:00 2001 From: Pavel Strunkin Date: Wed, 27 May 2020 19:12:31 +0200 Subject: [PATCH 3/5] Update workflow.yml --- .github/workflows/workflow.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index ca4ff277..9feb2d0b 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -40,3 +40,6 @@ jobs: - name: Apply DB migrations run: npx prisma migrate up -c --experimental + + - name: Run e2e tests + run: npm run test:e2e From 1bad9b843a937088696f07cae30b91e2d2447c0c Mon Sep 17 00:00:00 2001 From: Pavel Strunkin Date: Wed, 27 May 2020 19:35:28 +0200 Subject: [PATCH 4/5] Update workflow.yml --- .github/workflows/workflow.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 9feb2d0b..f9ae0f9a 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -38,6 +38,11 @@ jobs: 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: '10s' + - name: Apply DB migrations run: npx prisma migrate up -c --experimental From 6914be04a08f927e1e10aa31545c1219143e8e04 Mon Sep 17 00:00:00 2001 From: Pavel Strunkin Date: Wed, 27 May 2020 19:59:31 +0200 Subject: [PATCH 5/5] Update workflow.yml --- .github/workflows/workflow.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index f9ae0f9a..c05971d1 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -2,24 +2,17 @@ name: CI -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch on: push: branches: [ master ] pull_request: branches: [ master ] -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" build: - # The type of runner that the job will run on runs-on: ubuntu-latest - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 - name: Setup Node.js environment @@ -41,7 +34,7 @@ jobs: - name: Wait untill DB started (workaround of https://github.com/Harmon758/postgresql-action/issues/7) uses: jakejarvis/wait-action@v0.1.0 with: - time: '10s' + time: '5s' - name: Apply DB migrations run: npx prisma migrate up -c --experimental