Skip to content

Commit

Permalink
ci: move dry-run to a parallel workflow
Browse files Browse the repository at this point in the history
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š <oss@bajtos.net>
  • Loading branch information
bajtos committed May 2, 2024
1 parent 05da282 commit bfc3d33
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 7 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/dry-run.yml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit bfc3d33

Please sign in to comment.