Skip to content

Commit

Permalink
separate test and publish workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
gurza committed Sep 20, 2023
1 parent 7ee575e commit 52ed40a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
23 changes: 2 additions & 21 deletions .github/workflows/npm-publish-github-packages.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,12 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Node.js Package

on:
push:
branches:
- publish-package
env:
DATABASE_NAME: ${{ vars.DATABASE_NAME }}
NODE_ENV: development
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
- name: Add authorized key
run: echo '${{ secrets.AUTHORIZED_KEY }}' > tests/authorized_key.json
- run: npm test

publish-gpr:
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -34,7 +15,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm run build
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: test

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- run: npm ci
- name: Add authorized key
run: echo '${{ secrets.AUTHORIZED_KEY }}' > tests/authorized_key.json
- name: Run tests
env:
DATABASE_NAME: ${{ vars.DATABASE_NAME }}
NODE_ENV: development
run: npm test

0 comments on commit 52ed40a

Please sign in to comment.