Skip to content

Commit

Permalink
Merge pull request #20559 from emberjs/pnpm
Browse files Browse the repository at this point in the history
Switch to pnpm
  • Loading branch information
ef4 authored Oct 18, 2023
2 parents c521894 + 5772625 commit b6b05da
Show file tree
Hide file tree
Showing 52 changed files with 14,187 additions and 12,241 deletions.
35 changes: 35 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Setup node and pnpm
description: Setup node and install dependencies using pnpm
inputs:
use_lockfile:
description: 'Whether to use the lockfile vs latest floating dependencies'
required: false
default: true
runs:
using: 'composite'
steps:
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
cache: pnpm
- uses: actions/cache@v3
name: Setup cache for puppeteer
with:
# See .puppeteerrc.cjs, where we set this as the place puppeteer
# installs the browser. It needs to be cached the same as our pnpm
# packages are because it won't get reinstalled if our modules are
# cached.
path: .puppeteer-cache
key: ${{ runner.os }}-puppeteer-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-puppeteer-
- run: pnpm install ${{ fromJSON('{"false":"--no-lockfile", "true":"--frozen-lockfile"}')[inputs.use_lockfile] }}
shell: bash
19 changes: 4 additions & 15 deletions .github/workflows/alpha-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
- name: install dependencies
run: yarn install --frozen-lockfile --non-interactive
- uses: ./.github/actions/setup
- name: build
env:
DISABLE_SOURCE_MAPS: true
BROCCOLI_ENV: production
run: yarn ember build
run: pnpm ember build
- name: test
env:
TEST_SUITE: each-package
run: yarn test
run: pnpm test

release:
name: Tag + Release
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
registry-url: 'https://registry.npmjs.org'
- name: install dependencies
run: yarn install --frozen-lockfile --non-interactive
- uses: ./.github/actions/setup
- name: setup git
run: |
git config --local user.email '[email protected]'
Expand Down
151 changes: 37 additions & 114 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
- name: install dependencies
run: yarn install --frozen-lockfile --non-interactive
- uses: ./.github/actions/setup
- name: linting
run: yarn lint
run: pnpm lint

types:
name: Type Checking (current version)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
- name: install dependencies
run: yarn install --frozen-lockfile --non-interactive
- uses: ./.github/actions/setup
- name: Check published and internal types
run: yarn type-check
run: pnpm type-check

types-range:
name: Type Checking (other supported versions)
Expand All @@ -55,35 +45,25 @@ jobs:
ts-version: ['4.9', '5.0', 'next']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
- name: install dependencies
run: yarn install --frozen-lockfile --non-interactive
- uses: ./.github/actions/setup
- name: build stable type definitions
run: yarn build:types
run: pnpm build:types
- name: install TS@${{matrix.ts-version}}
run: yarn add -D typescript@${{ matrix.ts-version }}
run: pnpm add --save-dev typescript@${{ matrix.ts-version }}
- name: Check published and internal types with TS@${{matrix.ts-version}}
run: yarn type-check
run: pnpm type-check

basic-test:
name: Debug and Prebuilt (All Tests by Package + Canary Features)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
- name: install dependencies
run: yarn install --frozen-lockfile --non-interactive
- uses: ./.github/actions/setup
- name: build
env:
DISABLE_SOURCE_MAPS: true
BROCCOLI_ENV: production
run: yarn ember build
run: pnpm ember build
- name: Upload build
uses: actions/upload-artifact@v3
with:
Expand All @@ -92,26 +72,21 @@ jobs:
- name: test
env:
TEST_SUITE: each-package
run: yarn test
run: pnpm test

browserstack-test:
name: Browserstack Tests (Safari, Edge)
runs-on: ubuntu-latest
needs: [basic-test, lint, types]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
- name: install dependencies
run: yarn install --frozen-lockfile --non-interactive
- uses: ./.github/actions/setup
- name: build
env:
DISABLE_SOURCE_MAPS: true
BROCCOLI_ENV: production
SHOULD_TRANSPILE: true
run: yarn ember build
run: pnpm ember build

- name: Set BrowserStack Local Identifier
if: startsWith(github.ref, 'refs/tags/v')
Expand All @@ -125,141 +100,105 @@ jobs:
# This is in plaintext on purpose. It has no privileged access to anything (this is a free
# account) and it allows us to run browserstack tests against PRs.
BROWSERSTACK_ACCESS_KEY: o5LNEdygq1SP4L9kst4s
run: yarn test:browserstack
run: pnpm test:browserstack

smoke-test:
name: Smoke tests (Full Ember Apps)
runs-on: ubuntu-latest
needs: [basic-test, lint, types]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
- name: install dependencies
run: yarn install --frozen-lockfile --non-interactive
- uses: ./.github/actions/setup
- name: build
run: yarn ember build -prod
run: pnpm ember build -prod
- name: test
# todo: potentially more apps? use matrix?
run: |
yarn link
cd smoke-tests/ember-test-app/
yarn
yarn link ember-source
yarn test
pnpm install
pnpm link ../..
pnpm test
production-test:
name: Production (All Tests + Canary Features)
runs-on: ubuntu-latest
needs: [basic-test, lint, types]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
- name: install dependencies
run: yarn install --frozen-lockfile --non-interactive
- uses: ./.github/actions/setup
- name: build
env:
DISABLE_SOURCE_MAPS: true
BROCCOLI_ENV: production
run: yarn ember build -prod
run: pnpm ember build -prod
- name: test
run: yarn test
run: pnpm test

production-debug-render-test:
name: Production (All Tests + Canary Features with Debug Render Tree)
runs-on: ubuntu-latest
needs: [basic-test, lint, types]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
- name: install dependencies
run: yarn install --frozen-lockfile --non-interactive
- uses: ./.github/actions/setup
- name: build
env:
DISABLE_SOURCE_MAPS: true
BROCCOLI_ENV: production
DEBUG_RENDER_TREE: true
run: yarn ember build -prod
run: pnpm ember build -prod
- name: test
run: yarn test
run: pnpm test

extend-prototypes-test:
name: Extend Prototypes
runs-on: ubuntu-latest
needs: [basic-test, lint, types]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
- name: install dependencies
run: yarn install --frozen-lockfile --non-interactive
- uses: ./.github/actions/setup
- uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: test
env:
TEST_SUITE: extend-prototypes
run: yarn test
run: pnpm test

node-test:
name: Node.js Tests
runs-on: ubuntu-latest
needs: [basic-test, lint, types]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
- name: install dependencies
run: yarn install --frozen-lockfile --non-interactive
- uses: ./.github/actions/setup
- name: build
env:
DISABLE_SOURCE_MAPS: true
BROCCOLI_ENV: production
SHOULD_TRANSPILE_FOR_NODE: true
run: yarn ember build -prod
run: pnpm ember build -prod
- name: test
run: yarn test:node
run: pnpm test:node

blueprint-test:
name: Blueprint Tests
runs-on: ubuntu-latest
needs: [lint]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
- name: install dependencies
run: yarn install --frozen-lockfile --non-interactive
- uses: ./.github/actions/setup
- name: test
run: yarn test:blueprints
run: pnpm test:blueprints

browser-test:
name: Browser Tests (Firefox)
runs-on: ubuntu-latest
needs: [basic-test, lint, types]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
- name: install dependencies
run: yarn install --frozen-lockfile --non-interactive
- uses: ./.github/actions/setup
- uses: actions/download-artifact@v3
with:
name: dist
Expand All @@ -270,7 +209,7 @@ jobs:
firefox-version: 102.0.1
- run: firefox --version
- name: test
run: yarn ember test -c testem.ci-browsers.js
run: pnpm ember test -c testem.ci-browsers.js

deploy-tag:
name: Deploy tags to npm
Expand All @@ -290,13 +229,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
registry-url: 'https://registry.npmjs.org'
cache: yarn
- name: install dependencies
run: yarn install --frozen-lockfile --non-interactive
- uses: ./.github/actions/setup
- name: build for publish
run: node bin/build-for-publishing.js
- name: publish to npm
Expand All @@ -323,12 +256,7 @@ jobs:
if: github.event_name == 'push' && contains(github.ref, 'cron') != true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
- name: install dependencies
run: yarn install --frozen-lockfile --non-interactive
- uses: ./.github/actions/setup
- name: build for publish
run: node bin/build-for-publishing.js
- name: publish to s3
Expand Down Expand Up @@ -357,12 +285,7 @@ jobs:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
- name: install dependencies
run: yarn install --frozen-lockfile --non-interactive
- uses: ./.github/actions/setup
- name: build for publish
run: node bin/build-for-publishing.js
- name: publish to s3
Expand Down
Loading

0 comments on commit b6b05da

Please sign in to comment.