Skip to content

Commit

Permalink
Improve Testing (#4325)
Browse files Browse the repository at this point in the history
  • Loading branch information
penalosa authored Nov 9, 2023
1 parent 902b5ba commit 9bc52cf
Show file tree
Hide file tree
Showing 135 changed files with 1,087 additions and 1,388 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/c3-checks.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/c3-e2e-project-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ env:
node-version: 18.17.1
jobs:
cleanup:
timeout-minutes: 30
name: "Cleanup Test Projects"
if: ${{ github.repository_owner == 'cloudflare' }}
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/c3-e2e-quarantine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ env:
bun-version: 1.0.3
jobs:
e2e:
timeout-minutes: 30
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.pm }}
cancel-in-progress: true
name: ${{ format('E2E ({0})', matrix.pm) }}
if: github.repository_owner == 'cloudflare'
strategy:
matrix:
os: [ubuntu-latest]
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/c3-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ env:
bun-version: 1.0.3
jobs:
e2e:
timeout-minutes: 30
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.pm }}
cancel-in-progress: true
name: ${{ format('E2E ({0})', matrix.pm) }}
if: github.repository_owner == 'cloudflare' && github.event.pull_request.user.login != 'dependabot[bot]'
strategy:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/choose-pages-projects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:

- name: Build
run: pnpm run build
env:
CI_OS: ${{ runner.os }}

- name: Build Quick Edit
run: cd packages/quick-edit && yarn setup && yarn custom:build
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/codecov-context.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
run: pnpm run build
env:
NODE_ENV: "production"
CI_OS: ${{ runner.os }}

- name: Run tests & collect coverage
run: pnpm run --filter wrangler test:ci
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/create-pullrequest-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ jobs:
if: ${{ github.repository_owner == 'cloudflare' }}
name: Build & Publish a Prerelease to the Adhoc Registry
runs-on: ubuntu-latest

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
timeout-minutes: 30
steps:
- name: Checkout Repo
uses: actions/checkout@v3
Expand Down Expand Up @@ -36,6 +39,8 @@ jobs:
# `extract-runtime-versions.mjs` needs to be able to resolve `miniflare`, but we want to have the correct
# `package.json` versions when we build packages for packing
run: pnpm run build --filter miniflare
env:
CI_OS: ${{ runner.os }}

- name: Extract runtime versions
run: node .github/extract-runtime-versions.mjs # extract versions before modifying version to include commit hash
Expand Down Expand Up @@ -63,6 +68,7 @@ jobs:
NODE_ENV: "production"
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
ALGOLIA_PUBLIC_KEY: ${{ secrets.ALGOLIA_PUBLIC_KEY }}
CI_OS: ${{ runner.os }}

- name: Pack miniflare
run: pnpm pack
Expand Down
53 changes: 0 additions & 53 deletions .github/workflows/d1.yml

This file was deleted.

6 changes: 6 additions & 0 deletions .github/workflows/deploy-pages-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:

jobs:
publish:
timeout-minutes: 30
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.package }}
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
Expand All @@ -24,6 +28,8 @@ jobs:

- name: Build
run: pnpm run build
env:
CI_OS: ${{ runner.os }}

- name: Deploy to Pages
run: pnpm --filter ${{ inputs.package }} run deploy
Expand Down
20 changes: 8 additions & 12 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,24 @@ name: E2E tests
on:
push:
branches:
- main
- changeset-release/main
pull_request:
types: [synchronize, opened, reopened, labeled, unlabeled]
repository_dispatch:

jobs:
e2e-test:
if: github.repository_owner == 'cloudflare' && (github.event_name != 'pull_request' || (github.event_name == 'pull_request' && contains(github.event.*.labels.*.name, 'e2e' )) || (github.event_name == 'pull_request' && github.head_ref == 'changeset-release/main'))
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.node }}
cancel-in-progress: true
timeout-minutes: 30
if: github.repository_owner == 'cloudflare' && (github.event_name != 'pull_request' || (github.event_name == 'pull_request' && contains(github.event.*.labels.*.name, 'e2e' )))
name: "E2E Test"
strategy:
fail-fast: false
matrix:
os: [
# macos-11,
# macos-12,
macos-13,
windows-2019,
windows-2022,
# ubuntu-20.04,
ubuntu-22.04,
]
node: ["16", "18"]
os: [macos-13, windows-2022, ubuntu-22.04]
node: ["18"]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repo
Expand Down Expand Up @@ -55,6 +50,7 @@ jobs:
run: pnpm run build
env:
NODE_ENV: "production"
CI_OS: ${{ runner.os }}

- name: Build Wrangler package for npm
run: pnpm pack --pack-destination $HOME
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/edge-preview-authenticated-proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
run: pnpm run build
env:
NODE_ENV: "production"
CI_OS: ${{ runner.os }}

- name: Build & Publish Worker
run: pnpm run publish
Expand Down
52 changes: 0 additions & 52 deletions .github/workflows/experimental-wasm-release.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/format-errors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
run: pnpm run build
env:
NODE_ENV: "production"
CI_OS: ${{ runner.os }}

- name: Build & Publish Worker
run: pnpm run publish
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:

jobs:
test:
timeout-minutes: 30
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}
cancel-in-progress: true
if: ${{ github.repository_owner == 'cloudflare' }}
name: "Tests"
strategy:
Expand Down Expand Up @@ -43,6 +47,7 @@ jobs:
run: pnpm run build
env:
NODE_ENV: "production"
CI_OS: ${{ runner.os }}

- name: Check for errors
run: pnpm run check
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/playground-preview-worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
run: pnpm run build
env:
NODE_ENV: "production"
CI_OS: ${{ runner.os }}

- name: Build & Publish Worker
run: pnpm run deploy
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/playground-worker-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
run: pnpm run build
env:
NODE_ENV: "production"
CI_OS: ${{ runner.os }}

- name: Build & Publish Testing Playground Worker
run: pnpm run deploy:testing
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/prerelease-create-cloudflare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
run: pnpm run build
env:
NODE_ENV: "production"
CI_OS: ${{ runner.os }}

- name: Publish Beta to NPM
run: pnpm publish --tag beta
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/prereleases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
- main
jobs:
prerelease:
timeout-minutes: 30
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
if: ${{ github.repository_owner == 'cloudflare' }}
name: Build & Publish a beta release to NPM
runs-on: ubuntu-latest
Expand Down Expand Up @@ -49,6 +53,7 @@ jobs:
run: pnpm run build
env:
NODE_ENV: "production"
CI_OS: ${{ runner.os }}

- name: Check for errors
run: pnpm run check
Expand All @@ -70,6 +75,7 @@ jobs:
working-directory: packages/wrangler

publish_prerelease_registry:
timeout-minutes: 30
if: ${{ github.repository_owner == 'cloudflare' }}
name: Publish Prerelease Registry
needs: prerelease
Expand Down Expand Up @@ -105,6 +111,7 @@ jobs:
NODE_ENV: "production"
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
ALGOLIA_PUBLIC_KEY: ${{ secrets.ALGOLIA_PUBLIC_KEY }}
CI_OS: ${{ runner.os }}

- name: Build & Publish Prerelease Registry
run: pnpm run publish
Expand Down
Loading

0 comments on commit 9bc52cf

Please sign in to comment.