Diffinery

homeflare/diffinerypublic

Open-source, agent-first GitHub and GitHub Actions alternative that runs on your own Cloudflare account: git hosting, pull requests, code review and drop-in GitHub Actions YAML on Workers, Durable Objects, R2 and Containers.

65 lines · 2.1 KBRaw History
1name: CI
2
3# Deploy waits for this workflow to pass on main. The end-to-end suite is its own
4# workflow (e2e.yml), so deploys don't wait for it too.
5#
6# Every job of this repository's workflows runs on the label in the repository variable
7# DIFFINERY_RUNS_ON, else ubuntu-latest (a hosted runner on Diffinery too). The GitHub copy
8# sets `diffinery` to run on diffinery.com's GitHub runners; forks need nothing.
9
10on:
11 push:
12 branches: [main]
13 pull_request:
14
15permissions:
16 contents: read
17
18concurrency:
19 group: ci-${{ github.ref }}
20 cancel-in-progress: true
21
22jobs:
23 # Two jobs in parallel: each needs the install and build, but typecheck and the unit
24 # tests together took longer than either does alone.
25 typecheck:
26 name: Typecheck and bundle
27 runs-on: ${{ vars.DIFFINERY_RUNS_ON || 'ubuntu-latest' }}
28 timeout-minutes: 20
29 steps:
30 - uses: actions/checkout@v4
31 - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0
32 - uses: actions/setup-node@v4
33 with:
34 node-version: 22
35 cache: pnpm
36 - run: pnpm install --frozen-lockfile
37 - name: Build
38 run: pnpm -r --if-present build
39 - name: Typecheck
40 run: pnpm -r --if-present typecheck
41 - name: Bundle the Worker (dry run)
42 working-directory: apps/diffinery
43 run: pnpm exec wrangler deploy --dry-run --env dev --outdir dist
44
45 test:
46 name: Unit tests (${{ matrix.shard }}/2)
47 runs-on: ${{ vars.DIFFINERY_RUNS_ON || 'ubuntu-latest' }}
48 timeout-minutes: 20
49 # Two halves of every package's test files, side by side: CI is the first step of a deploy.
50 strategy:
51 fail-fast: false
52 matrix:
53 shard: [1, 2]
54 steps:
55 - uses: actions/checkout@v4
56 - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0
57 - uses: actions/setup-node@v4
58 with:
59 node-version: 22
60 cache: pnpm
61 - run: pnpm install --frozen-lockfile
62 - name: Build
63 run: pnpm -r --if-present build
64 - name: Unit tests
65 run: pnpm -r --if-present run test --shard=${{ matrix.shard }}/2