From a67b50296bf53f7c0ca9e90f89f517542d05645e Mon Sep 17 00:00:00 2001 From: Christopher Kolstad Date: Thu, 4 Mar 2021 14:27:43 +0100 Subject: [PATCH] chore: setup separate workflow for PRs --- .editorconfig | 3 +++ .github/workflows/build.yaml | 4 ++- .github/workflows/build_prs.yaml | 46 ++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build_prs.yaml diff --git a/.editorconfig b/.editorconfig index afff24bb76..0a800d5b07 100644 --- a/.editorconfig +++ b/.editorconfig @@ -14,3 +14,6 @@ trim_trailing_whitespace = false [*.json] indent_size = 2 + +[*.yaml] +indent_size = 2 diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 856f5084b9..aa73c44842 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -3,9 +3,11 @@ name: Build & Tests on: pull_request: push: + branches: + - master + jobs: build: - runs-on: ubuntu-latest strategy: diff --git a/.github/workflows/build_prs.yaml b/.github/workflows/build_prs.yaml new file mode 100644 index 0000000000..ff21a4ef76 --- /dev/null +++ b/.github/workflows/build_prs.yaml @@ -0,0 +1,46 @@ +name: PullRequest + +on: + pull_request: + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x, 14.x] + services: + # Label used to access the service container + postgres: + # Docker Hub image + image: postgres + # Provide the password for postgres + env: + POSTGRES_PASSWORD: postgres + # Set health checks to wait until postgres has started + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: yarn + - run: yarn lint + - run: yarn run test:coverage + env: + CI: true + TEST_DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres + DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }}