Skip to content

Commit

Permalink
Merge pull request #226 from siguici/main
Browse files Browse the repository at this point in the history
👷 Use the @siguici's setup-js action
  • Loading branch information
siguici authored Jan 12, 2025
2 parents e47aee9 + 49b5025 commit e7c3394
Showing 1 changed file with 15 additions and 62 deletions.
77 changes: 15 additions & 62 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,77 +6,30 @@ on:
- main
pull_request:

defaults:
run:
working-directory: ./libs/create-qwikdev-astro

jobs:
test:
name: 🧪 Test the CLI on ${{ matrix.runtime }} under ${{ matrix.os }} using ${{ matrix.package_manager }}
name: 🧪 Test the CLI on ${{ matrix.runtime }} under ${{ matrix.os }} using ${{ matrix.pm }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
experimental: [false]
runtime: [node, deno, bun]
package_manager: [npm, pnpm]
exclude:
- runtime: deno
package_manager: pnpm
- runtime: bun
package_manager: pnpm
pm: ["", pnpm, yarn]

steps:
- name: 🚚 Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
if: matrix.runtime == 'node'
uses: actions/setup-node@v3
with:
node-version: 22
uses: actions/checkout@v4

- name: Set up Deno
if: matrix.runtime == 'deno'
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: 🔥 Remove lockfile
run: rm pnpm-lock.yaml

- name: Set up Bun
if: matrix.runtime == 'bun'
uses: oven-sh/setup-bun@v2
- name: Setup Test Environment
uses: siguici/setup-js@v1
with:
bun-version: latest

- name: ⚡️Install dependencies
run: |
if [[ "${{ matrix.runtime }}" == "node" ]]; then
corepack enable
corepack prepare ${{ matrix.package_manager }}@latest --activate
${{ matrix.package_manager }} install
elif [[ "${{ matrix.runtime }}" == "deno" ]]; then
deno install
elif [[ "${{ matrix.runtime }}" == "bun" ]]; then
bun install
fi
shell: bash

- name: 📦️ Build the package
run: |
if [[ "${{ matrix.runtime }}" == "node" ]]; then
${{ matrix.package_manager }} run build
elif [[ "${{ matrix.runtime }}" == "deno" ]]; then
deno task build
elif [[ "${{ matrix.runtime }}" == "bun" ]]; then
bun run build
fi
shell: bash

- name: ✅ Test CLI
run: |
if [[ "${{ matrix.runtime }}" == "node" ]]; then
${{ matrix.package_manager }} run test
elif [[ "${{ matrix.runtime }}" == "deno" ]]; then
deno task test
elif [[ "${{ matrix.runtime }}" == "bun" ]]; then
bun run test
fi
shell: bash
runtime: ${{ matrix.runtime }}
pm: ${{ matrix.pm }}
scripts: build,test
cwd: ./libs/create-qwikdev-astro

0 comments on commit e7c3394

Please sign in to comment.