58
.github/workflows/ci.yml
vendored
Normal file
58
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
name: ci
|
||||
|
||||
on:
|
||||
pull_request: { branches: [main] }
|
||||
push: { branches: [main] }
|
||||
|
||||
jobs:
|
||||
build-test:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
env:
|
||||
NODE_OPTIONS: --max-old-space-size=4096
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
# Run codex-cli/ tasks first because they are higher signal.
|
||||
|
||||
- name: Install dependencies (codex-cli)
|
||||
working-directory: codex-cli
|
||||
run: npm ci
|
||||
|
||||
- name: Check formatting (codex-cli)
|
||||
working-directory: codex-cli
|
||||
run: npm run format
|
||||
|
||||
- name: Run tests (codex-cli)
|
||||
working-directory: codex-cli
|
||||
run: npm run test
|
||||
|
||||
- name: Lint (codex-cli)
|
||||
working-directory: codex-cli
|
||||
run: |
|
||||
npm run lint -- \
|
||||
--rule "no-console:error" \
|
||||
--rule "no-debugger:error" \
|
||||
--max-warnings=-1
|
||||
|
||||
- name: Type‑check (codex-cli)
|
||||
working-directory: codex-cli
|
||||
run: npm run typecheck
|
||||
|
||||
- name: Build (codex-cli)
|
||||
working-directory: codex-cli
|
||||
run: npm run build
|
||||
|
||||
# Run formatting checks in the root directory last.
|
||||
|
||||
- name: Install dependencies (root)
|
||||
run: npm ci
|
||||
|
||||
- name: Check formatting (root)
|
||||
run: npm run format
|
||||
43
.github/workflows/dco.yml
vendored
Normal file
43
.github/workflows/dco.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name: dco
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read # minimum needed
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with: { fetch-depth: 0 } # make sure base SHA exists
|
||||
|
||||
- name: Verify Signed‑off‑by lines
|
||||
shell: bash
|
||||
run: |
|
||||
base="${{ github.event.pull_request.base.sha }}"
|
||||
head="${{ github.event.pull_request.head.sha }}"
|
||||
|
||||
unsigned=$(git log --format='%h %s' "$base..$head" | while read sha _; do
|
||||
git show -s --format='%B' "$sha" | grep -qi '^Signed-off-by:' || echo "$sha"
|
||||
done)
|
||||
|
||||
if [ -n "$unsigned" ]; then
|
||||
echo "::error ::❌ DCO check failed."
|
||||
echo ""
|
||||
echo "Commits missing the 'Signed-off-by:' footer:"
|
||||
echo "$unsigned"
|
||||
echo ""
|
||||
echo "🛠 **Quick fix (make ONE signed commit):**"
|
||||
echo " git fetch origin"
|
||||
echo " git reset --soft origin/${GITHUB_BASE_REF}"
|
||||
echo " git commit -s -m \"<your message>\""
|
||||
echo " git push --force-with-lease"
|
||||
echo ""
|
||||
echo "🔧 **Fix individual commits:**"
|
||||
echo " git rebase -i origin/${GITHUB_BASE_REF} --exec \"git commit --amend -s --no-edit\""
|
||||
echo " git push --force-with-lease"
|
||||
echo ""
|
||||
echo "💡 Or edit the commit message in GitHub UI and add:"
|
||||
echo " Signed-off-by: Your Name <email@example.com>"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user