Skip to content

Commit bca04bb

Browse files
Nikola HristovNikola Hristov
authored andcommitted
2 parents 4f712f4 + aa598e3 commit bca04bb

File tree

92 files changed

+30016
-804
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+30016
-804
lines changed

.github/dependabot.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# This file will create many PRs, one for each example.
2+
# From what I can tell, we are forced into approaching it this way
3+
# because of the many workspace roots.
4+
5+
version: 2
6+
updates:
7+
- package-ecosystem: "npm"
8+
directory: "/examples/basic"
9+
schedule:
10+
interval: "weekly"
11+
labels:
12+
- "area: examples"
13+
open-pull-requests-limit: 1
14+
versioning-strategy: "increase"
15+
allow:
16+
- dependency-type: "direct"
17+
assignees:
18+
- "anthonyshew"
19+
groups:
20+
basic:
21+
patterns:
22+
- "*"
23+
update-types:
24+
- "minor"
25+
26+
- package-ecosystem: "npm"
27+
directory: "/examples/kitchen-sink"
28+
schedule:
29+
interval: "weekly"
30+
labels:
31+
- "area: examples"
32+
open-pull-requests-limit: 1
33+
versioning-strategy: "increase"
34+
allow:
35+
- dependency-type: "direct"
36+
assignees:
37+
- "anthonyshew"
38+
groups:
39+
kitchen-sink:
40+
patterns:
41+
- "*"
42+
update-types:
43+
- "minor"
44+
ignore:
45+
# Types are just...broken?
46+
- dependency-name: "@types/express"
47+
# Remix is behind on updating these peer deps and npm doesn't like it
48+
- dependency-name: "react"
49+
- dependency-name: "react-dom"
50+
- dependency-name: "@types/react"
51+
- dependency-name: "@types/react-dom"
52+
# We can't upgrade versions of this due to npm
53+
- dependency-name: "vite"
54+
55+
- package-ecosystem: "npm"
56+
directory: "/examples/non-monorepo"
57+
schedule:
58+
interval: "weekly"
59+
labels:
60+
- "area: examples"
61+
open-pull-requests-limit: 1
62+
versioning-strategy: "increase"
63+
allow:
64+
- dependency-type: "direct"
65+
assignees:
66+
- "anthonyshew"
67+
groups:
68+
non-monorepo:
69+
patterns:
70+
- "*"
71+
update-types:
72+
- "minor"
73+
74+
- package-ecosystem: "npm"
75+
directory: "/examples/with-shell-commands"
76+
schedule:
77+
interval: "weekly"
78+
labels:
79+
- "area: examples"
80+
open-pull-requests-limit: 1
81+
versioning-strategy: "increase"
82+
allow:
83+
- dependency-type: "direct"
84+
assignees:
85+
- "anthonyshew"
86+
groups:
87+
with-shell-commands:
88+
patterns:
89+
- "*"
90+
update-types:
91+
- "minor"
92+
93+
- package-ecosystem: "npm"
94+
directory: "/examples/with-svelte"
95+
schedule:
96+
interval: "weekly"
97+
labels:
98+
- "area: examples"
99+
open-pull-requests-limit: 1
100+
versioning-strategy: "increase"
101+
allow:
102+
- dependency-type: "direct"
103+
assignees:
104+
- "anthonyshew"
105+
groups:
106+
with-svelte:
107+
patterns:
108+
- "*"
109+
update-types:
110+
- "minor"
111+
112+
- package-ecosystem: "npm"
113+
directory: "/examples/with-tailwind"
114+
schedule:
115+
interval: "weekly"
116+
labels:
117+
- "area: examples"
118+
open-pull-requests-limit: 1
119+
versioning-strategy: "increase"
120+
allow:
121+
- dependency-type: "direct"
122+
assignees:
123+
- "anthonyshew"
124+
groups:
125+
with-tailwind:
126+
patterns:
127+
- "*"
128+
update-types:
129+
- "minor"

.github/workflows/lint.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Lint
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
paths:
7+
- ".github/actions/**"
8+
- .github/workflows/lint.yml
9+
- "**/*.{yml,yaml,md,mdx,js,jsx,ts,tsx,json,toml,css}"
10+
- pnpm-lock.yaml
11+
- package.json
12+
- "Cargo.**"
13+
- "crates/**"
14+
- ".cargo/**"
15+
- rust-toolchain
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
19+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
20+
21+
permissions:
22+
actions: write
23+
contents: read
24+
pull-requests: read
25+
26+
jobs:
27+
rust_lint:
28+
name: Rust lints
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v3
33+
34+
- name: Setup Rust
35+
uses: ./.github/actions/setup-rust
36+
with:
37+
github-token: "${{ secrets.GITHUB_TOKEN }}"
38+
39+
- name: Run cargo fmt check
40+
run: |
41+
cargo fmt --check
42+
43+
- name: Check Cargo.toml formatting (taplo)
44+
run: npx @taplo/cli@0.5.2 format --check
45+
46+
- name: Check licenses
47+
uses: EmbarkStudios/cargo-deny-action@v1
48+
with:
49+
command: check licenses
50+
51+
format_lint:
52+
name: Formatting
53+
runs-on: ubuntu-latest
54+
env:
55+
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
56+
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
57+
TURBO_REMOTE_ONLY: true
58+
steps:
59+
- name: Checkout
60+
uses: actions/checkout@v3
61+
62+
- name: "Setup Node"
63+
uses: ./.github/actions/setup-node
64+
with:
65+
extra-flags: --no-optional
66+
node-version: "20"
67+
68+
- name: Install Global Turbo
69+
uses: ./.github/actions/install-global-turbo
70+
71+
- name: Lint
72+
# Manually set TURBO_API to an empty string to override Hetzner env
73+
run: |
74+
TURBO_API= turbo run lint --env-mode=strict
75+
76+
cleanup:
77+
name: Cleanup
78+
needs:
79+
- rust_lint
80+
- format_lint
81+
if: always()
82+
uses: ./.github/workflows/pr-clean-caches.yml
83+
secrets: inherit
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: JS Package Tests
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
paths:
7+
- package.json
8+
- pnpm-workspace.yaml
9+
- pnpm-lock.yaml
10+
- "packages/**"
11+
- ".github/actions/**"
12+
- ".github/workflows/test-js-packages.yml"
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
16+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
17+
18+
permissions:
19+
actions: write
20+
contents: read
21+
pull-requests: read
22+
23+
jobs:
24+
js_packages:
25+
name: "JS Package Tests (${{matrix.os.name}}, Node ${{matrix.node-version}})"
26+
timeout-minutes: 30
27+
runs-on: ${{ matrix.os.runner }}
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
os:
32+
- name: ubuntu
33+
runner: ubuntu-latest
34+
- name: macos
35+
runner: macos-13
36+
node-version:
37+
- 18
38+
- 20
39+
env:
40+
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
41+
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
42+
TURBO_REMOTE_ONLY: true
43+
44+
steps:
45+
# on main -> current + prev commit
46+
# pr -> pr commits + base commit
47+
- name: Determine fetch depth
48+
id: fetch-depth
49+
run: |
50+
echo "depth=$(( ${{ github.event.pull_request.commits || 1 }} + 1 ))" >> $GITHUB_OUTPUT
51+
52+
- name: Checkout
53+
uses: actions/checkout@v4
54+
with:
55+
ref: ${{ github.ref }}
56+
fetch-depth: ${{ steps.fetch-depth.outputs.depth }}
57+
58+
- name: "Setup Node"
59+
uses: ./.github/actions/setup-node
60+
with:
61+
extra-flags: --no-optional
62+
node-version: ${{ matrix.node-version }}
63+
env:
64+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
65+
66+
- name: Install Global Turbo
67+
uses: ./.github/actions/install-global-turbo
68+
69+
- name: Run tests
70+
# We manually set TURBO_API to an empty string to override Hetzner env
71+
# We filter out turborepo-repository because it's a native package and needs
72+
# to run when turbo core changes. This job (`js_packages`) does not run on turborpeo core
73+
# changes, and we don't want to enable that beahvior for _all_ our JS packages.
74+
run: |
75+
TURBO_API= turbo run check-types test --filter="!turborepo-repository" --filter={./packages/*}...[${{ github.event.pull_request.base.sha || 'HEAD^1' }}] --color --env-mode=strict
76+
env:
77+
NODE_VERSION: ${{ matrix.node-version }}
78+
79+
summary:
80+
name: Turborepo JS Test Summary
81+
runs-on: ubuntu-latest
82+
if: always()
83+
needs:
84+
- js_packages
85+
steps:
86+
- name: Compute info
87+
run: |
88+
cancelled=false
89+
failure=false
90+
91+
subjob () {
92+
local result=$1
93+
if [ "$result" = "cancelled" ]; then
94+
cancelled=true
95+
elif [ "$result" != "success" ] && [ "$result" != "skipped" ]; then
96+
failure=true
97+
fi
98+
}
99+
100+
subjob ${{needs.js_packages.result}}
101+
102+
if [ "$cancelled" = "true" ]; then
103+
echo "Job was cancelled."
104+
exit 0
105+
elif [ "$failure" = "true" ]; then
106+
echo "Job failed."
107+
exit 1
108+
else
109+
echo "Job succeeded."
110+
exit 0
111+
fi

0 commit comments

Comments
 (0)