Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make test required to run successfully before deploying previews #35

Merged
merged 3 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading