Skip to content

Commit b1a446e

Browse files
committed
Update mirror CI workflow
1 parent be4c622 commit b1a446e

1 file changed

Lines changed: 22 additions & 11 deletions

File tree

.github/workflows/ci.yml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# CI for the xata-cli mirror.
22
#
33
# Verifies the standalone mirror builds from source using only its committed
4-
# lockfile and packages published to npm — the guarantee tracked in xataio/cli#2.
5-
# The monorepo's mirror sync regenerates pnpm-lock.yaml on every push, so
6-
# `--frozen-lockfile` here proves the committed lockfile stays in sync.
4+
# lockfile and packages published to npm. The monorepo's mirror sync regenerates
5+
# pnpm-lock.yaml on every push, so `--frozen-lockfile` here proves the committed
6+
# lockfile stays in sync.
77
#
88
# Maintained directly in this repo (.github is not part of the synced subtree).
99
name: CI
@@ -36,11 +36,22 @@ jobs:
3636
- name: Install (frozen lockfile)
3737
run: pnpm install --frozen-lockfile
3838

39-
- name: Typecheck
40-
run: pnpm run tsc
41-
42-
- name: Build
43-
run: pnpm run build
44-
45-
- name: Unit tests
46-
run: pnpm run test-unit
39+
- name: Run package checks
40+
run: |
41+
run_if_present() {
42+
local script="$1"
43+
if node -e "process.exit(require('./package.json').scripts?.[process.argv[1]] ? 0 : 1)" "$script"; then
44+
pnpm run "$script"
45+
else
46+
echo "Skipping missing script: $script"
47+
fi
48+
}
49+
50+
run_if_present tsc
51+
run_if_present build
52+
53+
if node -e "process.exit(require('./package.json').scripts?.['test-unit'] ? 0 : 1)"; then
54+
pnpm run test-unit
55+
else
56+
run_if_present test
57+
fi

0 commit comments

Comments
 (0)