Skip to content

Commit b27e2f0

Browse files
committed
chore: cleanup
- remove unused projects - run all tests in CI, update GH actions, cache pnpm store
1 parent 4faf234 commit b27e2f0

52 files changed

Lines changed: 101 additions & 309540 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: 'bootstrap-monorepo'
2+
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: Install Node.js
7+
uses: actions/setup-node@v6
8+
with:
9+
node-version-file: '.nvmrc'
10+
11+
- name: Install and enable corepack
12+
shell: bash
13+
run: |
14+
npm install -g corepack@0.34.5
15+
pnpm --version
16+
17+
- name: Determine some values needed to cache the pnpm store
18+
id: determine-values-for-pnpm-store-cache
19+
shell: bash
20+
run: |
21+
# hash of store must include
22+
# - the operating system (which is roughly represented by RUNNER_OS)
23+
# - the CPU architecture (represented by RUNNER_ARCH)
24+
# - the lockfile (which is represented by hashing pnpm-lock.yaml)
25+
# - the Node.js version because of the side-effects cache of pnpm which caches compiled binaries (represented by hashing .nvmrc)
26+
#
27+
# actions/setup-node would have built-in caching logic for pnpm projects, but it does not
28+
# consider CPU Arch and Node version, see
29+
# - https://github.com/actions/setup-node/blob/c7a93deeacd27a63bee8be26a3bf77dc8fb6ce05/src/cache-restore.ts#L41-L42
30+
# - https://github.com/actions/setup-node/issues/641
31+
pnpm_store_cache_key=pnpm-store-cache-$RUNNER_OS-$RUNNER_ARCH-${{ hashFiles('.nvmrc') }}-${{ hashFiles('pnpm-lock.yaml') }}
32+
pnpm_store_cache_key_fallback=pnpm-store-cache-$RUNNER_OS-$RUNNER_ARCH-${{ hashFiles('.nvmrc') }}-
33+
pnpm_store_path=$(pnpm store path --silent)
34+
35+
mkdir -p "${pnpm_store_path}"
36+
37+
echo "pnpm-store-cache-key=$pnpm_store_cache_key" >> "$GITHUB_OUTPUT"
38+
echo "pnpm-store-cache-key-fallback=$pnpm_store_cache_key_fallback" >> "$GITHUB_OUTPUT"
39+
echo "pnpm-store-path=$pnpm_store_path" >> "$GITHUB_OUTPUT"
40+
41+
- name: Download cached pnpm store
42+
uses: actions/cache/restore@v5
43+
with:
44+
key: ${{ steps.determine-values-for-pnpm-store-cache.outputs.pnpm-store-cache-key }}
45+
path: ${{ steps.determine-values-for-pnpm-store-cache.outputs.pnpm-store-path }}
46+
restore-keys: |
47+
${{ steps.determine-values-for-pnpm-store-cache.outputs.pnpm-store-cache-key-fallback }}
48+
49+
- name: Install dependencies
50+
shell: bash
51+
run: |
52+
pnpm install --frozen-lockfile
53+
54+
- name: Upload new pnpm store to cache
55+
if: ${{ github.ref_name == 'main' }}
56+
uses: actions/cache/save@v5
57+
with:
58+
key: ${{ steps.determine-values-for-pnpm-store-cache.outputs.pnpm-store-cache-key }}
59+
path: ${{ steps.determine-values-for-pnpm-store-cache.outputs.pnpm-store-path }}

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: '🔎 CI'
2+
3+
# configure concurrency: cancel pending and in-progress workflow runs if a new commit to the same branch is pushed (`github.head_ref` is the source branch of PRs)
4+
concurrency:
5+
group: ${{ github.workflow }}-${{ github.head_ref }}
6+
cancel-in-progress: true
7+
8+
# Remove default permissions of GITHUB_TOKEN for security
9+
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
10+
permissions: {}
11+
12+
on:
13+
push:
14+
branches:
15+
- main
16+
pull_request:
17+
types:
18+
- opened # new PR was created
19+
- synchronize # the last commit of the `head_ref` (= source branch) changed, e.g. a new commit was pushed or the source branch was rebased
20+
- ready_for_review # the PR switched from draft to non-draft
21+
- reopened # PR had been closed and got reopened
22+
workflow_dispatch:
23+
24+
jobs:
25+
test:
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v6
31+
32+
- name: Bootstrap monorepo
33+
uses: ./.github/actions/bootstrap-monorepo
34+
35+
- name: Build
36+
run: pnpm run build
37+
38+
- name: Run tests
39+
run: pnpm run --recursive test

.github/workflows/test-pkg-consumption.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4+
pnpm exec prettier --ignore-unknown --check .
45
pnpm exec superturbo build lint
56
pnpm exec prettier --ignore-unknown --check .

packages/browser-tools/.eslintrc.cjs

Lines changed: 0 additions & 15 deletions
This file was deleted.

packages/browser-tools/SKILL.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

packages/browser-tools/bin/browser-tools-cli.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

packages/browser-tools/package.json

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)