build: use tsup, add more tests #931
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: Pull Request | |
on: | |
- pull_request | |
jobs: | |
build-and-test: | |
name: Build and test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x, 18.x, 20.x] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build --if-present | |
- name: Test build output | |
run: npm run test:ci | |
- name: Codecov | |
uses: codecov/codecov-action@v3 # https://github.com/codecov/codecov-action | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Typecheck build output | |
run: npm run typecheck | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: npm ci | |
- name: Lint | |
run: npm run lint:check | |
format: | |
name: Format | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: npm ci | |
- name: Format | |
run: npm run format:check |