diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 218f305..98cfb88 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,128 +13,10 @@ concurrency: cancel-in-progress: true jobs: - lint: - name: Lint - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - uses: pnpm/action-setup@v4 - with: - version: 9 - - - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: "pnpm" - - - run: pnpm install --frozen-lockfile - - run: pnpm run test:lint - - format: - name: Format + checkout-and-setup: + name: Checkout and setup runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: "pnpm" - - - run: pnpm install --frozen-lockfile - - run: pnpm run test:format - - build-and-test-node: - name: "[node] build and test" - runs-on: ubuntu-latest - timeout-minutes: 20 - strategy: - fail-fast: false - matrix: - node-version: [18, 20] - steps: - - uses: actions/checkout@v4 - - - uses: pnpm/action-setup@v4 - with: - version: 9 - - - name: Build and test using Node.js v${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - cache: "pnpm" - - - run: pnpm install --frozen-lockfile - - run: pnpm -r build - - run: pnpm run test:unit - - build-and-test-bun: - name: "[bun] build and test" - runs-on: ubuntu-latest - timeout-minutes: 20 - strategy: - fail-fast: false - matrix: - bun-version: ["latest"] - steps: - - uses: actions/checkout@v4 - - - uses: pnpm/action-setup@v4 - with: - version: 9 - - - name: Build and test using bun ${{ matrix.bun-version }} - uses: oven-sh/setup-bun@v1 - with: - bun-version: ${{ matrix.bun-version }} - - - run: bun run pnpm install --frozen-lockfile - - run: bun run pnpm -r build - - run: bun run test:unit - - build-and-test-other-envs: - name: "[happy-dom, edge-runtime] test" - runs-on: ubuntu-latest - timeout-minutes: 20 - strategy: - fail-fast: false - steps: - - uses: actions/checkout@v4 - - - uses: pnpm/action-setup@v4 - with: - version: 9 - - - name: Build using Node.js v20 - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: "pnpm" - - - run: pnpm install --frozen-lockfile - - run: pnpm -r build - - - name: Test using happy-dom - run: pnpm run test:unit-browser - - - name: Test using edge-runtime - run: pnpm run test:unit-edge - - publish-preview: - name: "Publish preview" - runs-on: ubuntu-latest - needs: build-and-test-node - if: success() - timeout-minutes: 20 - strategy: - fail-fast: false steps: - name: Checkout code uses: actions/checkout@v4 @@ -143,18 +25,143 @@ jobs: uses: pnpm/action-setup@v4 with: version: 9 + lint: + name: Lint + needs: checkout-and-setup + runs-on: ubuntu-latest - - name: Enable corepack - uses: actions/setup-node@v4 + steps: + - uses: actions/setup-node@v4 with: node-version: 20 cache: "pnpm" - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Build - run: pnpm -r build + - run: pnpm install --frozen-lockfile + - run: pnpm run test:lint - - name: Publish - run: pnpx pkg-pr-new publish './packages/*' './plugins/*' --no-template --pnpm --compact + # format: + # name: Format + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + + # - uses: pnpm/action-setup@v4 + # with: + # version: 9 + + # - uses: actions/setup-node@v4 + # with: + # node-version: 20 + # cache: "pnpm" + + # - run: pnpm install --frozen-lockfile + # - run: pnpm run test:format + + # build-and-test-node: + # name: "[node] build and test" + # runs-on: ubuntu-latest + # timeout-minutes: 20 + # strategy: + # fail-fast: false + # matrix: + # node-version: [18, 20] + # steps: + # - uses: actions/checkout@v4 + + # - uses: pnpm/action-setup@v4 + # with: + # version: 9 + + # - name: Build and test using Node.js v${{ matrix.node-version }} + # uses: actions/setup-node@v4 + # with: + # node-version: ${{ matrix.node-version }} + # cache: "pnpm" + + # - run: pnpm install --frozen-lockfile + # - run: pnpm -r build + # - run: pnpm run test:unit + + # build-and-test-bun: + # name: "[bun] build and test" + # runs-on: ubuntu-latest + # timeout-minutes: 20 + # strategy: + # fail-fast: false + # matrix: + # bun-version: ["latest"] + # steps: + # - uses: actions/checkout@v4 + + # - uses: pnpm/action-setup@v4 + # with: + # version: 9 + + # - name: Build and test using bun ${{ matrix.bun-version }} + # uses: oven-sh/setup-bun@v1 + # with: + # bun-version: ${{ matrix.bun-version }} + + # - run: bun run pnpm install --frozen-lockfile + # - run: bun run pnpm -r build + # - run: bun run test:unit + + # build-and-test-other-envs: + # name: "[happy-dom, edge-runtime] test" + # runs-on: ubuntu-latest + # timeout-minutes: 20 + # strategy: + # fail-fast: false + # steps: + # - uses: actions/checkout@v4 + + # - uses: pnpm/action-setup@v4 + # with: + # version: 9 + + # - name: Build using Node.js v20 + # uses: actions/setup-node@v4 + # with: + # node-version: 20 + # cache: "pnpm" + + # - run: pnpm install --frozen-lockfile + # - run: pnpm -r build + + # - name: Test using happy-dom + # run: pnpm run test:unit-browser + + # - name: Test using edge-runtime + # run: pnpm run test:unit-edge + + # publish-preview: + # name: "Publish preview" + # runs-on: ubuntu-latest + # needs: build-and-test-node + # if: success() + # timeout-minutes: 20 + # strategy: + # fail-fast: false + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + + # - name: Setup pnpm + # uses: pnpm/action-setup@v4 + # with: + # version: 9 + + # - name: Enable corepack + # uses: actions/setup-node@v4 + # with: + # node-version: 20 + # cache: "pnpm" + + # - name: Install dependencies + # run: pnpm install --frozen-lockfile + + # - name: Build + # run: pnpm -r build + + # - name: Publish + # run: pnpx pkg-pr-new publish './packages/*' './plugins/*' --no-template --pnpm --compact