This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Merge into main 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: | |
name: Publish package to npm 🚀 | |
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" | |
- name: Install packages | |
run: pnpm install | |
- name: Run build command | |
run: pnpm build | |
- name: Publish to npm 🚀 | |
shell: bash | |
run: pnpm publish --access public --no-git-checks | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |