Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 154 additions & 0 deletions .github/workflows/ci-package-manager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
name: ci-package-manager

# This workflow creates a tarball from repo sources.
# It then checks that each of the following package managers is able to install:
# - npm
# - Yarn v1 Classic
# - Yarn (Modern)
# - pnpm
# - bun

on:
workflow_call:

jobs:
build-tarball:
runs-on: ubuntu-latest

steps:
- name: Check out repo
uses: actions/checkout@v6

- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: "lts/*"

- name: Install dependencies
run: npm install

- name: Build tarball
run: npm pack --workspace packages 2>/dev/null || npm pack
Comment thread
lumirlumir marked this conversation as resolved.

- name: Upload build artifact
uses: actions/upload-artifact@v5
Comment thread
lumirlumir marked this conversation as resolved.
with:
name: build
path: "*.tgz"
retention-days: 1

npm-install:
needs: build-tarball

runs-on: ubuntu-latest

steps:
- name: Download build artifact
uses: actions/download-artifact@v6
with:
name: build

- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: "lts/*"

- name: npm install
run: |
npm install ./*.tgz -D
Comment thread
lumirlumir marked this conversation as resolved.

yarn-v1-install:
needs: build-tarball

runs-on: ubuntu-latest

steps:
- name: Download build artifact
uses: actions/download-artifact@v6
with:
name: build

- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: "lts/*"

- name: yarn add
run: |
yarn add ./*.tgz -D
Comment thread
lumirlumir marked this conversation as resolved.

yarn-install:
needs: build-tarball

runs-on: ubuntu-latest

steps:
- name: Download build artifact
uses: actions/download-artifact@v6
with:
name: build

- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: "lts/*"

- name: Install Corepack latest
run: |
npm install -g corepack@latest
Comment thread
lumirlumir marked this conversation as resolved.
corepack enable yarn

- name: yarn add
run: |
corepack use yarn@latest
Comment thread
lumirlumir marked this conversation as resolved.
yarn init -p
yarn add ./*.tgz -D
Comment thread
lumirlumir marked this conversation as resolved.
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: 0 # Allow installs to modify lockfile

pnpm-install:
needs: build-tarball

runs-on: ubuntu-latest

steps:
- name: Download build artifact
uses: actions/download-artifact@v6
with:
name: build

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: latest

- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: "lts/*"

- name: pnpm add
run: |
cat > .npmrc <<EOT
auto-install-peers=true
node-linker=hoisted
EOT
Comment thread
lumirlumir marked this conversation as resolved.
pnpm add ./*.tgz -D
Comment thread
lumirlumir marked this conversation as resolved.

bun-install:
needs: build-tarball

runs-on: ubuntu-latest

steps:
- name: Download build artifact
uses: actions/download-artifact@v6
with:
name: build

- name: Set up Bun
uses: oven-sh/setup-bun@v2

- name: bun install
run: |
bun install ./*.tgz -D
Comment thread
lumirlumir marked this conversation as resolved.