From e59a37ab21a07aaa6149a6bc4ccda842b6bdd39c Mon Sep 17 00:00:00 2001 From: John Harlow Date: Fri, 11 Oct 2024 14:03:03 -0700 Subject: [PATCH] feat(workflows): publish pipeline --- .github/workflows/main-merge.yml | 53 ++++++++++++++++++++++++++++++++ .github/workflows/pr-check.yml | 3 -- 2 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/main-merge.yml diff --git a/.github/workflows/main-merge.yml b/.github/workflows/main-merge.yml new file mode 100644 index 0000000..af7e878 --- /dev/null +++ b/.github/workflows/main-merge.yml @@ -0,0 +1,53 @@ +name: PR Checks +on: + push: + branches: [main] +jobs: + quality-check: + name: Node Quality Check + runs-on: ubuntu-latest + env: + PORT: 8000 + strategy: + matrix: + node-version: [20.x, 19.x, 18.x] + steps: + - uses: actions/checkout@v4 + - name: Setup DynamoDB local + run: docker run -d -p 8000:8000 amazon/dynamodb-local:latest + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: "pnpm" + - name: Install packages + run: pnpm install + - name: Run build command + run: pnpm build + - name: Run ESLint + run: pnpm lint + - name: Run test suite + run: pnpm test run + - name: Run 100% coverage check + run: pnpm coverage + publish: + runs-on: ubuntu-latest + needs: quality-check + steps: + - uses: actions/checkout@v4 + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + - name: Use Node.js 20 + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: "pnpm" + - uses: JS-DevTools/npm-publish@v3 + with: + token: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 6541438..f11b1e9 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -1,6 +1,3 @@ -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - name: PR Checks on: pull_request: