Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

poc: [M3-8631] - Use pnpm as our package manager #11000

Closed
Closed
Show file tree
Hide file tree
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
261 changes: 120 additions & 141 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,50 +15,46 @@ jobs:
package: ["linode-manager", "@linode/api-v4", "@linode/validation"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: pnpm/action-setup@v4
with:
node-version: "20.17"
- uses: actions/cache@v3
run_install: false
- uses: actions/setup-node@v4
with:
path: |
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn --frozen-lockfile
- run: yarn workspace ${{ matrix.package }} run lint
node-version: "20.17"
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: pnpm --filter ${{ matrix.package }} lint

build-validation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
node-version: "20.17"
- uses: actions/cache@v3
run_install: false
- uses: actions/setup-node@v4
with:
path: |
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn --frozen-lockfile
- run: yarn workspace @linode/validation run build
- uses: actions/upload-artifact@v3
node-version: "20.17"
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: pnpm --filter @linode/validation run build
- uses: actions/upload-artifact@v4
with:
name: packages-validation-lib
path: |
packages/validation/index.js
packages/validation/lib
path: packages/validation/lib

publish-validation:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
needs:
- build-validation
needs: build-validation
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: packages-validation-lib
path: packages/validation
path: packages/validation/lib
- uses: JS-DevTools/npm-publish@v1
id: npm-publish
with:
Expand All @@ -80,69 +76,61 @@ jobs:
runs-on: ubuntu-latest
needs: build-validation
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
node-version: "20.17"
- uses: actions/cache@v3
run_install: false
- uses: actions/setup-node@v4
with:
path: |
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn --frozen-lockfile
- uses: actions/download-artifact@v3
node-version: "20.17"
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- uses: actions/download-artifact@v4
with:
name: packages-validation-lib
path: packages/validation
- run: yarn workspace @linode/api-v4 run test
path: packages/validation/lib
- run: pnpm --filter @linode/api-v4 test

build-sdk:
runs-on: ubuntu-latest
needs:
- build-validation
needs: build-validation
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
node-version: "20.17"
- uses: actions/cache@v3
run_install: false
- uses: actions/setup-node@v4
with:
path: |
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- uses: actions/download-artifact@v3
node-version: "20.17"
cache: "pnpm"
- uses: actions/download-artifact@v4
with:
name: packages-validation-lib
path: packages/validation
- run: yarn --frozen-lockfile
- run: yarn workspace @linode/api-v4 run build
- uses: actions/upload-artifact@v3
path: packages/validation/lib
- run: pnpm install --frozen-lockfile
- run: pnpm --filter @linode/api-v4 build
- uses: actions/upload-artifact@v4
with:
name: packages-api-v4-lib
path: |
packages/api-v4/index.js
packages/api-v4/index.node.js
packages/api-v4/lib
path: packages/api-v4/lib

validate-sdk:
runs-on: ubuntu-latest
needs:
- build-sdk
needs: build-sdk
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.17"

# Download the validation and api-v4 artifacts (built packages)
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: packages-validation-lib
path: packages/validation
- uses: actions/download-artifact@v3
path: packages/validation/lib
- uses: actions/download-artifact@v4
with:
name: packages-api-v4-lib
path: packages/api-v4
path: packages/api-v4/lib

# Create an api-v4 tarball
- run: cd packages/api-v4 && npm pack --pack-destination ../../
Expand All @@ -162,95 +150,89 @@ jobs:

test-manager:
runs-on: ubuntu-latest
needs:
- build-sdk
needs: build-sdk
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
node-version: "20.17"
- uses: actions/cache@v3
run_install: false
- uses: actions/setup-node@v4
with:
path: |
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- uses: actions/download-artifact@v3
node-version: "20.17"
cache: "pnpm"
- uses: actions/download-artifact@v4
with:
name: packages-validation-lib
path: packages/validation
- uses: actions/download-artifact@v3
path: packages/validation/lib
- uses: actions/download-artifact@v4
with:
name: packages-api-v4-lib
path: packages/api-v4
- run: yarn --frozen-lockfile
- run: yarn workspace linode-manager run test
path: packages/api-v4/lib
- run: pnpm install --frozen-lockfile
- run: pnpm --filter @linode/manager test

test-search:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
node-version: "20.17"
- uses: actions/cache@v3
run_install: false
- uses: actions/setup-node@v4
with:
path: |
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn --frozen-lockfile
- run: yarn workspace @linode/search run test
node-version: "20.17"
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: pnpm --filter @linode/search test

typecheck-manager:
runs-on: ubuntu-latest
needs:
- build-sdk
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
node-version: "20.17"
- uses: actions/cache@v3
run_install: false
- uses: actions/setup-node@v4
with:
path: |
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- uses: actions/download-artifact@v3
node-version: "20.17"
cache: "pnpm"
- uses: actions/download-artifact@v4
with:
name: packages-validation-lib
path: packages/validation
- uses: actions/download-artifact@v3
path: packages/validation/lib
- uses: actions/download-artifact@v4
with:
name: packages-api-v4-lib
path: packages/api-v4
- run: yarn --frozen-lockfile
- run: yarn workspace linode-manager run typecheck
path: packages/api-v4/lib
- run: pnpm install --frozen-lockfile
- run: pnpm --filter @linode/manager typecheck

build-manager:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
needs:
- build-sdk
needs: build-sdk
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
node-version: "20.17"
- uses: actions/cache@v3
run_install: false
- uses: actions/setup-node@v4
with:
path: |
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- uses: actions/download-artifact@v3
node-version: "20.17"
cache: "pnpm"
- uses: actions/download-artifact@v4
with:
name: packages-validation-lib
path: packages/validation
- uses: actions/download-artifact@v3
path: packages/validation/lib
- uses: actions/download-artifact@v4
with:
name: packages-api-v4-lib
path: packages/api-v4
- run: yarn --frozen-lockfile
- run: yarn workspace linode-manager run build
- uses: actions/upload-artifact@v3
path: packages/api-v4/lib
- run: pnpm install --frozen-lockfile
- run: pnpm install @linode/manager build
- uses: actions/upload-artifact@v4
with:
name: packages-manager-build
path: packages/manager/build
Expand All @@ -264,11 +246,11 @@ jobs:
# If the validation publish failed we could have mismatched versions and a broken JS client
- publish-validation
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: packages-api-v4-lib
path: packages/api-v4
path: packages/api-v4/lib
- uses: JS-DevTools/npm-publish@v1
id: npm-publish
with:
Expand All @@ -288,43 +270,40 @@ jobs:

build-storybook:
runs-on: ubuntu-latest
needs:
- build-sdk
needs: build-sdk
env:
NODE_OPTIONS: --max-old-space-size=4096
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
node-version: "20.17"
- uses: actions/cache@v3
run_install: false
- uses: actions/setup-node@v4
with:
path: |
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- uses: actions/download-artifact@v3
node-version: "20.17"
cache: "pnpm"
- uses: actions/download-artifact@v4
with:
name: packages-validation-lib
path: packages/validation
- uses: actions/download-artifact@v3
path: packages/validation/lib
- uses: actions/download-artifact@v4
with:
name: packages-api-v4-lib
path: packages/api-v4
- run: yarn --frozen-lockfile
- run: yarn workspace linode-manager run build-storybook
- uses: actions/upload-artifact@v3
path: packages/api-v4/lib
- run: pnpm install --frozen-lockfile
- run: pnpm --filter @linode/manager build-storybook
- uses: actions/upload-artifact@v4
with:
name: storybook-build
path: packages/manager/storybook-static

publish-storybook:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
needs:
- build-storybook
needs: build-storybook
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: storybook-build
path: storybook/build
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
100755 β†’ 100644
Original file line number Diff line number Diff line change
@@ -1 +1 @@
yarn workspaces run precommit
pnpm run --parallel precommit
Loading
Loading