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

👷 Use the @siguici's setup-js action #226

Merged
merged 2 commits into from
Jan 12, 2025
Merged
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
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
Loading