From e27be683d213b8555fa060f4edad0a5fdfdbc8ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigui=20Kess=C3=A9=20Emmanuel?= Date: Sun, 12 Jan 2025 16:04:02 +0100 Subject: [PATCH 1/2] :construction_worker: Use the @siguici's setup-js action --- .github/workflows/cli.yml | 77 ++++++++------------------------------- 1 file changed, 15 insertions(+), 62 deletions(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 4a24ccc..3f1a11c 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -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: [npm, 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 From 49b5025751172e005e7156988f4c36ef787bba2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigui=20Kess=C3=A9=20Emmanuel?= Date: Sun, 12 Jan 2025 16:16:47 +0100 Subject: [PATCH 2/2] :green_heart: No need to specify NPM autodetected on Node.js --- .github/workflows/cli.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 3f1a11c..0f1e671 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -17,7 +17,7 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] experimental: [false] runtime: [node, deno, bun] - pm: [npm, pnpm, yarn, ""] + pm: ["", pnpm, yarn] steps: - name: 🚚 Checkout repository