Skip to content

Commit

Permalink
create separate file for filter + run previews only if test passes
Browse files Browse the repository at this point in the history
  • Loading branch information
brauliorivas committed Jun 5, 2024
1 parent 4a9ae4e commit c0fc564
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ on:
- closed

jobs:
test:
uses: key4hep/dmx/.github/workflows/test-previews.yml@main
with:
repository: ${{ github.event.pull_request.head.sha }}

deploy-preview:
needs: test
environment: github-pages
runs-on: ubuntu-latest
permissions:
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/test-previews.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Test previews
on:
workflow_call:
inputs:
repository:
required: true
type: string

jobs:
test:
environment: github-pages
runs-on: ubuntu-latest
steps:
- name: Checkout PR
uses: actions/checkout@v3
with:
ref: ${{ inputs.repository }}
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test

0 comments on commit c0fc564

Please sign in to comment.