Skip to content

Commit

Permalink
feat: Switch to pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Sep 17, 2022
1 parent c91cb9a commit 90695c8
Show file tree
Hide file tree
Showing 15 changed files with 11,563 additions and 32,408 deletions.
17 changes: 17 additions & 0 deletions .github/actions/pnpm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Setup node and pnpm
description: Setup node and install dependencies using pnpm
runs:
using: "composite"
steps:
- uses: volta-cli/action@v1
- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- uses: pnpm/[email protected]
with:
version: 7.11.0
run_install: true
110 changes: 75 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,91 @@ on:

env:
CI: true
CACHE_PATH: '**/node_modules'

jobs:
install_dependencies:
name: Install Dependencies
name: Install
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm

lint_js:
name: Lint JS
runs-on: ubuntu-latest
needs: [install_dependencies]
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- name: ESLint
run: pnpm lint

lint_tests:
name: Lint Tests
runs-on: ubuntu-latest
needs: [install_dependencies]
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- name: ESLint
run: pnpm lint
working-directory: tests

commits:
name: Commit Messages
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: volta-cli/action@v1
- uses: wagoid/[email protected]

types_library:
name: "Types: Library"
runs-on: ubuntu-latest
timeout-minutes: 2
needs: [install_dependencies]

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- run: tsc --build --clean && tsc --build
continue-on-error: true

types_tests:
name: "Types: Tests"
runs-on: ubuntu-latest
timeout-minutes: 2
needs: [install_dependencies]

steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
- uses: actions/cache@v2
with:
path: ${{ env.CACHE_PATH }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: "${{ runner.os }}-modules-"
- run: yarn global add pnpm
- run: yarn install
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- run: tsc --build --clean && tsc --build
continue-on-error: true
working-directory: tests

tests:
name: "Tests"
runs-on: ubuntu-latest
needs: [install_dependencies]
strategy:
matrix:
# all tests like this are slow
slow-test:
- basic conversion
- snapshots conversion

steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
- uses: actions/[email protected]
with:
path: ${{ env.CACHE_PATH }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- run: |
yarn install
yarn global add pnpm
yarn global add ember-cli
pnpm add --global ember-cli
- name: Tests
run: yarn test
working-directory: 'tests'
run: pnpm vitest --testNamePattern "${{ matrix.slow-test }}"

tooling:
name: Tooling
Expand All @@ -55,16 +103,10 @@ jobs:
needs: [install_dependencies]

steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
- uses: actions/[email protected]
with:
path: ${{ env.CACHE_PATH }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- run: yarn install
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- name: Semantic Release
run: yarn publish:dry-run
run: pnpm publish:dry-run
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -76,12 +118,10 @@ jobs:
needs: [tests]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: volta-cli/action@v1
- run: yarn install

- uses: ./.github/actions/pnpm
- name: Release
run: yarn publish:release
env:
Expand Down
73 changes: 0 additions & 73 deletions .github/workflows/quality.yml

This file was deleted.

Empty file modified bin.js
100644 → 100755
Empty file.
27 changes: 15 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,28 @@
"ember-addon-migrator": "./bin.js"
},
"exports": {
"import": "./index.js"
".": {
"import": "./index.js"
},
"./captured-addon": {
"import": "./src/captured-addon/index.js"
},
"./captured-addon/utils/fs-helpers": {
"import": "./src/captured-addon/utils/fs-helpers.js"
}
},
"files": [
"src/**/*",
"bin.js"
],
"scripts": {
"publish:dry-run": "yarn publish:release --dry-run",
"publish:release": "yarn semantic-release",
"publish:dry-run": "pnpm publish:release --dry-run",
"publish:release": "pnpm semantic-release",
"build:types": "tsc --build",
"lint": "yarn lint:js",
"lint": "pnpm lint:js",
"lint:js": "eslint .",
"lint:fix": "yarn lint:js --fix",
"test": "vitest --coverage --no-watch",
"test:watch": "vitest --watch"
"lint:fix": "pnpm lint:js --fix",
"test": "pnpm --filter 'tests' test"
},
"dependencies": {
"chalk": "^5.0.0",
Expand Down Expand Up @@ -67,7 +74,6 @@
"adm-zip": "^0.5.9",
"babel-eslint": "^10.1.0",
"broccoli-test-helper": "^2.0.0",
"c8": "^7.11.0",
"eslint": "^7.0.0",
"eslint-plugin-decorator-position": "^4.0.1",
"eslint-plugin-import": "^2.25.4",
Expand All @@ -76,12 +82,9 @@
"lodash": "^4.17.21",
"node-fetch": "^3.2.0",
"prettier": "^2.5.1",
"scenario-tester": "^2.0.1",
"semantic-release": "^19.0.0",
"types-package-json": "^2.0.39",
"typescript": "4.5.4",
"vite": "^2.7.13",
"vitest": "^0.3.0"
"typescript": "4.5.4"
},
"engines": {
"node": ">=16.0.0"
Expand Down
Loading

0 comments on commit 90695c8

Please sign in to comment.