Skip to content

Commit

Permalink
Merge pull request #35 from brauliorivas/test-previews
Browse files Browse the repository at this point in the history
Make test required to run successfully before deploying previews
  • Loading branch information
kjvbrt authored Jun 6, 2024
2 parents 3342c54 + c0fc564 commit 74755b1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 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
4 changes: 1 addition & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Build and test
on:
push:
branches: [main]
pull_request:
types: [opened, reopened, synchronize]
branches: [main, release]

jobs:
test:
Expand Down

0 comments on commit 74755b1

Please sign in to comment.