Skip to content

Commit 8bc6eff

Browse files
#795 Add CI setup script for dependency management
Prompts: - Implement a bash script here that clones the SolidOS/solid-logic repo from github, runs its build scripts, and uses npm to install it as a local depdency to solid-ui - Default to using the same branch name as the one were the CI is running, using the GITHUB_BASE_REF env variable AI work summary: - Introduced a new script `setup-ci.sh` to clone, build, and link the solid-logic repository as a peer dependency for CI. - Updated the CI workflow to run the setup script after installing npm dependencies. Co-Authored-By: Cursor <cursoragent@cursor.com>
1 parent 9301716 commit 8bc6eff

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
with:
2323
node-version: ${{ matrix.node-version }}
2424
- run: npm ci
25+
- run: scripts/setup-ci.sh
2526
- run: npm test
2627
- run: npm run build
2728
- run: npm run doc

scripts/setup-ci.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Clone, build, and link solid-logic for CI (peer dependency of solid-ui).
5+
# Run after `npm ci` so the local install is not removed.
6+
7+
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
8+
SOLID_LOGIC_DIR="${ROOT_DIR}/.ci-deps/solid-logic"
9+
SOLID_LOGIC_REPO="https://github.com/SolidOS/solid-logic.git"
10+
SOLID_LOGIC_REF="${GITHUB_BASE_REF:-${GITHUB_REF_NAME:-main}}"
11+
12+
echo ">>>>> Setting up solid-logic from ${SOLID_LOGIC_REPO} (${SOLID_LOGIC_REF})"
13+
14+
rm -rf "$SOLID_LOGIC_DIR"
15+
mkdir -p "$(dirname "$SOLID_LOGIC_DIR")"
16+
git clone --depth 1 --branch "$SOLID_LOGIC_REF" "$SOLID_LOGIC_REPO" "$SOLID_LOGIC_DIR"
17+
18+
echo ">>>>> Installing solid-logic dependencies"
19+
(cd "$SOLID_LOGIC_DIR" && npm ci)
20+
21+
echo ">>>>> Building solid-logic"
22+
(cd "$SOLID_LOGIC_DIR" && npm run build)
23+
24+
echo ">>>>> Installing solid-logic as a local dependency in solid-ui"
25+
cd "$ROOT_DIR"
26+
npm install --no-save "solid-logic@file:${SOLID_LOGIC_DIR}"
27+
28+
echo ">>>>> solid-logic setup complete"

0 commit comments

Comments
 (0)