Skip to content

Commit

Permalink
Fix running create tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Hilzu committed Jul 15, 2024
1 parent ea452ae commit 3dc8790
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
33 changes: 26 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ jobs:
name: Create
strategy:
matrix:
os: [ubuntu, windows, macos]
node-version: [18.x, 20.x, 22.x]
os: [ubuntu]
node-version: [22.x]
package-manager: [npm, yarn, pnpm]
runs-on: ${{ matrix.os }}-latest
env:
NODE_DEBUG: create-ts-node
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
Expand All @@ -39,19 +41,36 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm install --production
- run: ${{ matrix.package-manager }} install
env:
NODE_ENV: production

- run: npm install --global .
if: matrix.package-manager == 'npm'
- run: npx create-ts-node new-project
if: matrix.package-manager == 'npm'
working-directory: ${{ runner.temp }}

- run: yarn link
if: matrix.package-manager == 'yarn'
- run: yarn create ts-node new-project
if: matrix.package-manager == 'yarn'
working-directory: ${{ runner.temp }}

- name: Create empty package.json for pnpm
- name: Create package.json for pnpm
run: |
with open("package.json", "w") as f:
with open('package.json', 'w') as f:
f.write('{}')
shell: python
if: matrix.package-manager == 'pnpm'
working-directory: ${{ runner.temp }}
- run: pnpm link ${{ github.workspace }}
if: matrix.package-manager == 'pnpm'
working-directory: ${{ runner.temp }}
- run: pnpm exec create-ts-node new-project
if: matrix.package-manager == 'pnpm'
- run: ${{ matrix.package-manager }} exec create-ts-node new-project
working-directory: ${{ runner.temp }}

- run: ${{ matrix.package-manager }} install
working-directory: ${{ runner.temp }}/new-project
- run: ${{ matrix.package-manager }} run build
Expand Down
2 changes: 1 addition & 1 deletion create.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const mapObject = (obj, mapper) =>
Object.fromEntries(Object.entries(obj).map(mapper));

const create = async () => {
log(`Creating project ${projectName}`);
log(`Creating ASDF project ${projectName}`);
try {
await mkdir(projectPath);
} catch (err) {
Expand Down

0 comments on commit 3dc8790

Please sign in to comment.