Add support for testing exported types via tsd-lite #1033
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: Continuous Integration | |
on: [push, pull_request] | |
# TODO: Fix Horrendous CI jobs | |
# There's got to be a way around copy-pasting the Node+PNPM+caching scripts everywhere, right? | |
# I tried to do this with a reusable workflow, but it wasn't having it. | |
# Perhaps I'll fix it in future or preferably, someone who actually knows | |
# how to use this thing will magically appear. | |
jobs: | |
checks: | |
name: Linters | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 'lts/*' | |
registry-url: https://registry.npmjs.org | |
- uses: pnpm/action-setup@v2 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 8.6.1 | |
- name: Set PNPM Cache Directory | |
id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
name: Restore PNPM Package Cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- run: pnpm install | |
- run: pnpm run prettier:check | |
- run: pnpm run lint:check | |
tests: | |
name: Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 'lts/*' | |
registry-url: https://registry.npmjs.org | |
- uses: pnpm/action-setup@v2 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 8.6.1 | |
- name: Set PNPM Cache Directory | |
id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
name: Restore PNPM Package Cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- run: pnpm install | |
- run: pnpm run test:ci | |
- run: pnpm install codecov -g | |
- run: codecov -f ./coverage/clover.xml -t ${{ secrets.CODECOV_TOKEN }} | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 'lts/*' | |
registry-url: https://registry.npmjs.org | |
- uses: pnpm/action-setup@v2 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 8.6.1 | |
- name: Set PNPM Cache Directory | |
id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
name: Restore PNPM Package Cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- run: pnpm install | |
- run: pnpm run build:esm5 | |
- run: pnpm run build:cjs | |
- run: pnpm run build:umd | |
- run: pnpm run build:types | |
commitlint: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 'lts/*' | |
registry-url: https://registry.npmjs.org | |
- uses: pnpm/action-setup@v2 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 8.6.1 | |
- name: Set PNPM Cache Directory | |
id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- name: Print versions | |
run: | | |
git --version | |
node --version | |
npm --version | |
npx commitlint --version | |
pnpm --version | |
- uses: actions/cache@v3 | |
name: Restore PNPM Package Cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install commitlint | |
run: | | |
pnpm install | |
pnpm install conventional-changelog-conventionalcommits | |
pnpm install commitlint@latest | |
- name: Validate current commit (last commit) with commitlint | |
if: github.event_name == 'push' | |
run: pnpm exec commitlint --from HEAD~1 --to HEAD --verbose | |
- name: Validate PR commits with commitlint | |
if: github.event_name == 'pull_request' | |
run: pnpm exec commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose |