From bfc3d339a87e7a2cb056c6477e9317c702350482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Thu, 2 May 2024 10:14:11 +0200 Subject: [PATCH] ci: move dry-run to a parallel workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also skip the entire workflow when a pull request comes from a fork (and therefore does not have access to our GHA secrets). Signed-off-by: Miroslav Bajtoš --- .github/workflows/ci.yml | 7 ------ .github/workflows/dry-run.yml | 40 +++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/dry-run.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5538dce..64f43d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,13 +31,6 @@ jobs: node-version: 20 - run: npm ci - run: npm test - - name: Evaluate the last Spark round in dry-run mode - # Don't run on forks, which don't have access to secrets - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository - run: node bin/dry-run.js - env: - GLIF_TOKEN: ${{ secrets.GLIF_TOKEN }} - docker-build: runs-on: ubuntu-latest diff --git a/.github/workflows/dry-run.yml b/.github/workflows/dry-run.yml new file mode 100644 index 0000000..491a177 --- /dev/null +++ b/.github/workflows/dry-run.yml @@ -0,0 +1,40 @@ +name: CI +on: + push: + # Run on all branches in our repo, so that we test dry-run for our PRs too + # branches: [main] + # Don't run on forks, which don't have access to secrets + # pull_request: + # branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + services: + postgres: + image: postgres:latest + env: + POSTGRES_DB: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_USER: postgres + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + env: + DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + - run: npm ci + - name: Evaluate the last Spark round in dry-run mode + # Don't run on forks, which don't have access to secrets + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository + run: node bin/dry-run.js + env: + GLIF_TOKEN: ${{ secrets.GLIF_TOKEN }}