diff --git a/.github/workflows/canary-ci.yml b/.github/workflows/canary-ci.yml new file mode 100644 index 000000000..cd577afab --- /dev/null +++ b/.github/workflows/canary-ci.yml @@ -0,0 +1,13 @@ +name: Canary CI + +on: + issue_comment: + types: [created] + +jobs: + canary-ci: + if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '/canary-ci run') }} + steps: + - uses: ./.github/workflows/ci.yml + with: + react_version: 'canary' diff --git a/.github/workflows/ci-wip.yml b/.github/workflows/ci-wip.yml new file mode 100644 index 000000000..a14d82b7e --- /dev/null +++ b/.github/workflows/ci-wip.yml @@ -0,0 +1,115 @@ +name: CI-WIP + +on: + pull_request: + types: [synchronize] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test-wip: + name: WIP Test on (Node ${{ matrix.version }}) + strategy: + fail-fast: false + matrix: + version: [18.17.0, 20.8.0, 22.7.0] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.version }} + cache: '' + cache-dependency-path: '**/pnpm-lock.yaml' + - run: pnpm install --frozen-lockfile + - run: | + pnpm -r update react@canary react-dom@canary react-server-dom-webpack@canary + - run: pnpm test + + build-wip: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18 + cache: '' + cache-dependency-path: '**/pnpm-lock.yaml' + - run: pnpm install --frozen-lockfile + - run: | + sed -i~ '/"peerDependencies"/,${s/ :".*"/: "*"/}' packages/waku/package.json + pnpm -r update react@canary react-dom@canary react-server-dom-webpack@canary + - run: pnpm run compile + - uses: actions/upload-artifact@v4 + with: + name: create-waku + path: | + packages/create-waku + !packages/create-waku/node_modules + if-no-files-found: error + - uses: actions/upload-artifact@v4 + with: + name: waku + path: | + packages/waku + !packages/waku/node_modules + if-no-files-found: error + + e2e-wip: + name: WIP E2E on ${{ matrix.os }} (Node ${{ matrix.version }}) - (${{ matrix.shared }}/4) + needs: + - build-wip + strategy: + fail-fast: false + matrix: + shared: [1, 2, 3, 4] + shardTotal: [4] + os: [ubuntu-latest, windows-latest, macos-latest] + version: [18.17.0, 20.8.0, 22.7.0] + exclude: + - os: macos-latest + version: 18.17.0 + - os: macos-latest + version: 20.8.0 + - os: windows-latest + version: 18.17.0 + - os: windows-latest + version: 20.8.0 + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.version }} + cache: '' + cache-dependency-path: '**/pnpm-lock.yaml' + - run: pnpm install --frozen-lockfile + - uses: actions/download-artifact@v4 + with: + name: create-waku + path: packages/create-waku + - uses: actions/download-artifact@v4 + with: + name: waku + path: packages/waku + - name: Install Playwright + id: install-playwright + uses: ./.github/actions/playwright + - run: | + pnpm -r update react@canary react-dom@canary react-server-dom-webpack@canary + pnpm install --lockfile-only + - run: pnpm exec playwright test --shard=${{ matrix.shared }}/${{ matrix.shardTotal }} + env: + TEMP_DIR: ${{ runner.temp }} + - uses: actions/upload-artifact@v3 + if: always() + with: + name: playwright-report-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.shared }} + path: test-results/ + retention-days: 30 + if-no-files-found: ignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9baa7bb8b..be593b4cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,12 @@ on: push: branches: [main] pull_request: - types: [opened, synchronize] + types: [opened] + workflow_call: + inputs: + react_version: + required: true + type: string concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -24,9 +29,12 @@ jobs: - uses: actions/setup-node@v4 with: node-version: ${{ matrix.version }} - cache: 'pnpm' + cache: ${{ !inputs.react_version && 'pnpm' || '' }} cache-dependency-path: '**/pnpm-lock.yaml' - run: pnpm install --frozen-lockfile + - if: ${{ inputs.react_version }} + run: | + pnpm -r update react@${{ inputs.react_version }} react-dom@${{ inputs.react_version }} react-server-dom-webpack@${{ inputs.react_version }} - run: pnpm test build: @@ -37,9 +45,13 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 18 - cache: 'pnpm' + cache: ${{ !inputs.react_version && 'pnpm' || '' }} cache-dependency-path: '**/pnpm-lock.yaml' - run: pnpm install --frozen-lockfile + - if: ${{ inputs.react_version }} + run: | + sed -i~ '/"peerDependencies"/,${s/ :".*"/: "*"/}' packages/waku/package.json + pnpm -r update react@${{ inputs.react_version }} react-dom@${{ inputs.react_version }} react-server-dom-webpack@${{ inputs.react_version }} - run: pnpm run compile - uses: actions/upload-artifact@v4 with: @@ -76,7 +88,6 @@ jobs: version: 18.17.0 - os: windows-latest version: 20.8.0 - runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -84,7 +95,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version: ${{ matrix.version }} - cache: 'pnpm' + cache: ${{ !inputs.react_version && 'pnpm' || '' }} cache-dependency-path: '**/pnpm-lock.yaml' - run: pnpm install --frozen-lockfile - uses: actions/download-artifact@v4 @@ -98,6 +109,10 @@ jobs: - name: Install Playwright id: install-playwright uses: ./.github/actions/playwright + - if: ${{ inputs.react_version }} + run: | + pnpm -r update react@${{ inputs.react_version }} react-dom@${{ inputs.react_version }} react-server-dom-webpack@${{ inputs.react_version }} + pnpm install --lockfile-only - run: pnpm exec playwright test --shard=${{ matrix.shared }}/${{ matrix.shardTotal }} env: TEMP_DIR: ${{ runner.temp }}