From 52ed40aed0a3ac699d30b1ad4337a5ac176f308c Mon Sep 17 00:00:00 2001 From: Sergei Popinevskii Date: Wed, 20 Sep 2023 12:57:40 +0300 Subject: [PATCH] separate test and publish workflows --- .../workflows/npm-publish-github-packages.yml | 23 ++----------------- .github/workflows/test.yml | 20 ++++++++++++++++ 2 files changed, 22 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/npm-publish-github-packages.yml b/.github/workflows/npm-publish-github-packages.yml index e6b35d5..085d535 100644 --- a/.github/workflows/npm-publish-github-packages.yml +++ b/.github/workflows/npm-publish-github-packages.yml @@ -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 @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..81051d7 --- /dev/null +++ b/.github/workflows/test.yml @@ -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