ci.yml
This file
Path
.github/workflows/ci.yml
298 lines 路 10.6 KiB 路 YAML
Last changed by
test: move adapter runtime tests into `adapters/*` (#5466)Yusuke Wadabefore adoption645ddd6
History of this fileTake it
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299name: cion: push: branches: [main, next] paths-ignore: - 'adapters/**' pull_request: branches: ['*'] paths-ignore: - 'adapters/**' - 'docs/**' - '.vscode/**' - 'README.md' - '.gitignore' - 'LICENSE'
permissions: contents: read
jobs: coverage: name: 'Coverage' runs-on: ubuntu-latest needs: - main - bun - deno steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6 with: pattern: coverage-* merge-multiple: true path: ./coverage - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 with: fail_ci_if_error: true directory: ./coverage
main: name: 'Main' runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: node-version-file: '.tool-versions' - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 with: bun-version-file: '.tool-versions' - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 with: cache: true run_install: true - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: node-version-file: '.tool-versions' - run: pnpm run check - run: pnpm run editorconfig-checker -format github-actions - run: pnpm run build - run: pnpm run test - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5 with: name: coverage-main path: coverage/
jsr-dry-run: name: "Checking if it's valid for JSR" runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2 with: deno-version-file: '.tool-versions' - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 with: bun-version-file: '.tool-versions' - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 with: cache: true run_install: true - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: node-version-file: '.tool-versions' - run: pnpm dlx jsr publish --dry-run
deno: name: 'Deno' runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2 with: deno-version-file: '.tool-versions' - run: env NAME=Deno deno test --coverage=coverage/raw/deno-runtime --allow-read --allow-env --allow-write --allow-net -c runtime-tests/deno/deno.json runtime-tests/deno - run: deno test -c runtime-tests/deno-jsx/deno.precompile.json --coverage=coverage/raw/deno-precompile-jsx runtime-tests/deno-jsx - run: deno test -c runtime-tests/deno-jsx/deno.react-jsx.json --coverage=coverage/raw/deno-react-jsx runtime-tests/deno-jsx - run: grep -R '"url":' coverage | grep -v runtime-tests | sed -e 's/.*file:..//;s/.,//' | xargs deno cache --unstable-sloppy-imports - run: deno coverage --lcov > coverage/deno-runtime-coverage-lcov.info - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5 with: name: coverage-deno path: coverage/
bun: name: 'Bun' runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 with: bun-version-file: '.tool-versions' - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 with: cache: true run_install: true - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: node-version-file: '.tool-versions' - run: pnpm run test:bun - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5 with: name: coverage-bun path: coverage/
bun-windows: name: 'Bun - Windows' runs-on: windows-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 with: bun-version-file: '.tool-versions' - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 with: cache: true run_install: true - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: node-version-file: '.tool-versions' - run: pnpm run test:bun
fastly: name: 'Fastly Compute' runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 with: bun-version-file: '.tool-versions' - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 with: cache: true run_install: true - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: node-version-file: '.tool-versions' - run: pnpm run build - run: pnpm run test:fastly
node: name: 'Node.js v${{ matrix.node }}' runs-on: ubuntu-latest strategy: matrix: node: ['20.x', '22.x', '24.x'] steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: node-version: ${{ matrix.node }} - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 with: bun-version-file: '.tool-versions' - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 with: cache: true run_install: true - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: node-version-file: '.tool-versions' - run: pnpm run build - run: pnpm run test:node
workerd: name: 'workerd' runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: node-version-file: '.tool-versions' - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 with: bun-version-file: '.tool-versions' - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 with: cache: true run_install: true - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: node-version-file: '.tool-versions' - run: pnpm run build - run: pnpm run test:workerd
perf-measures-check-on-pr: name: 'Type & Bundle size Check on PR' runs-on: ubuntu-latest if: github.event_name == 'pull_request' permissions: contents: read pull-requests: write steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - uses: ./.github/actions/perf-measures with: target-ref: 'auto'
http-benchmark-on-pr: name: 'HTTP Speed Check on PR' runs-on: ubuntu-latest if: github.event_name == 'pull_request' permissions: contents: read pull-requests: write steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 with: bun-version-file: '.tool-versions' - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 with: cache: true run_install: true - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: node-version-file: '.tool-versions' - name: Install bombardier run: | wget -O bombardier https://github.com/codesenberg/bombardier/releases/download/v2.0.1/bombardier-linux-amd64 chmod +x bombardier sudo mv bombardier /usr/local/bin/ - name: Run HTTP benchmark run: | cd benchmarks/http-server bun run benchmark.ts - name: Comment PR uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7 if: github.event.pull_request.head.repo.full_name == github.repository with: script: | const fs = require('fs'); const results = fs.readFileSync('benchmarks/http-server/benchmark-results.md', 'utf8');
// Minimize previous benchmark comments const comments = await github.rest.issues.listComments({ owner: context.repo.owner, repo: context.repo.repo, issue_number: context.issue.number });
for (const comment of comments.data) { if (comment.body.includes('## HTTP Performance Benchmark')) { await github.graphql(` mutation { minimizeComment(input: { subjectId: "${comment.node_id}", classifier: OUTDATED }) { minimizedComment { isMinimized } } } `); } }
// Post new comment await github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, body: results }); - name: Show benchmark results for forks if: github.event.pull_request.head.repo.full_name != github.repository run: | echo "## HTTP Performance Benchmark Results" echo "Note: Cannot post comment due to security restrictions on fork PRs" cat benchmarks/http-server/benchmark-results.md
perf-measures-check-on-main: name: 'Type & Bundle size Check on Main' runs-on: ubuntu-latest if: github.ref == 'refs/heads/main' steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - uses: ./.github/actions/perf-measures with: target-ref: 'main'