Skip to content

Commit

Permalink
including running test in the publish workflow and excluding tests
Browse files Browse the repository at this point in the history
workflow from running on tag push
  • Loading branch information
osamaadam committed Jul 19, 2024
1 parent 3f0c09f commit 07e5337
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
name: Publish to npmjs
on:
workflow_run:
workflows:
- "Run Tests"
types:
- completed
branches:
- master
push:
tags:
- 'v*'

jobs:
publish:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' && github.ref_type == 'tag' && github.ref == 'refs/heads/master' }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js
Expand All @@ -22,6 +17,8 @@ jobs:
cache: 'npm'
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Run tests
run: npm test
- name: Build
run: npm run build
- name: Publish to npmjs
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: Run Tests
on: [push]
on:
push:
branches:
- '*'
tags-ignore:
- '*'

jobs:
test:
Expand Down

0 comments on commit 07e5337

Please sign in to comment.