ci: fix publishing workspace packages with pnpm #269
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: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test_and_build: | |
name: Test and build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- name: Setup pnpm cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Build | |
run: pnpm build | |
- name: Lint | |
run: pnpm lint | |
- name: Unit tests | |
run: pnpm test | |
- name: Types tests | |
run: pnpm test-types | |
- name: Bump version | |
run: pnpm release --skip.commit --skip.tag | |
- name: E2E tests | |
run: | | |
pnpm verdaccio & | |
pnpm config set '//localhost:4873/:_authToken' "fake" | |
pnpm local-publish | |
pnpm test-e2e |