From da2b285e428328b87563d3a88110ff0c95cbb0ac Mon Sep 17 00:00:00 2001 From: Sandro Circi Date: Mon, 14 Apr 2025 12:49:38 +0200 Subject: [PATCH 1/2] ci: separate ubuntu and windows builds --- .github/workflows/module.yml | 61 ++++++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 3 deletions(-) diff --git a/.github/workflows/module.yml b/.github/workflows/module.yml index 1405494619..1fa4b67e78 100644 --- a/.github/workflows/module.yml +++ b/.github/workflows/module.yml @@ -10,7 +10,7 @@ on: jobs: build: - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest permissions: contents: read @@ -18,7 +18,6 @@ jobs: strategy: matrix: - os: [ubuntu-latest, windows-latest] # macos-latest node: [22] env: @@ -65,9 +64,65 @@ jobs: run: pnpm run dev:vue:build - name: Publish - if: matrix.os != 'windows-latest' run: pnpx pkg-pr-new publish --compact --no-template --pnpm + build-platforms: + runs-on: ${{ matrix.os }} + + if: github.event_name == 'push' + + permissions: + contents: read + pull-requests: read + + strategy: + matrix: + os: [windows-latest] # macos-latest + node: [22] + + env: + NUXT_GITHUB_TOKEN: ${{ secrets.NUXT_GITHUB_TOKEN }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Install node + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + cache: pnpm + + - name: Install dependencies + run: pnpm install + + - name: Prepare + run: pnpm run dev:prepare + + - name: Lint + run: pnpm run lint + + - name: Typecheck + run: pnpm run typecheck + + - name: Test + run: pnpm run test run + + - name: Test (vue) + run: pnpm run test:vue run + + - name: Build + run: pnpm run build + + - name: Build playground + run: pnpm run dev:build + + - name: Build playground (vue) + run: pnpm run dev:vue:build + starter-nuxt: needs: build From 761c03d70c045f818f64281390681689143e180a Mon Sep 17 00:00:00 2001 From: Sandro Circi Date: Tue, 15 Apr 2025 18:04:01 +0200 Subject: [PATCH 2/2] CI: simplify conditional jobs --- .github/workflows/module.yml | 62 +++--------------------------------- 1 file changed, 4 insertions(+), 58 deletions(-) diff --git a/.github/workflows/module.yml b/.github/workflows/module.yml index 1fa4b67e78..7df5b68a27 100644 --- a/.github/workflows/module.yml +++ b/.github/workflows/module.yml @@ -10,7 +10,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} permissions: contents: read @@ -18,6 +18,7 @@ jobs: strategy: matrix: + os: ${{ github.event_name == 'pull_request' && fromJSON('["ubuntu-latest"]') || fromJSON('["ubuntu-latest", "windows-latest"]') }} # macos-latest node: [22] env: @@ -64,65 +65,10 @@ jobs: run: pnpm run dev:vue:build - name: Publish + # Only publish preview package on ubuntu during PRs + if: matrix.os == 'ubuntu-latest' run: pnpx pkg-pr-new publish --compact --no-template --pnpm - build-platforms: - runs-on: ${{ matrix.os }} - - if: github.event_name == 'push' - - permissions: - contents: read - pull-requests: read - - strategy: - matrix: - os: [windows-latest] # macos-latest - node: [22] - - env: - NUXT_GITHUB_TOKEN: ${{ secrets.NUXT_GITHUB_TOKEN }} - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install pnpm - uses: pnpm/action-setup@v4 - - - name: Install node - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: pnpm - - - name: Install dependencies - run: pnpm install - - - name: Prepare - run: pnpm run dev:prepare - - - name: Lint - run: pnpm run lint - - - name: Typecheck - run: pnpm run typecheck - - - name: Test - run: pnpm run test run - - - name: Test (vue) - run: pnpm run test:vue run - - - name: Build - run: pnpm run build - - - name: Build playground - run: pnpm run dev:build - - - name: Build playground (vue) - run: pnpm run dev:vue:build - starter-nuxt: needs: build