mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-03-27 09:45:53 +00:00
- Update mac.yml to use global VibeTunnel.xcworkspace instead of mac/VibeTunnel.xcworkspace - Update ios.yml to use global VibeTunnel.xcworkspace with VibeTunnel-iOS scheme - Fix Node.js workflow to use standard GitHub Actions runners (ubuntu-latest) and actions/setup-node@v4 - Use xcodebuild test instead of swift test for proper workspace testing support - Remove unnecessary cd commands since workspace is at root level This fixes CI failures after the global Apple workspace was introduced.
169 lines
No EOL
4.3 KiB
YAML
169 lines
No EOL
4.3 KiB
YAML
name: Node.js CI
|
|
|
|
on:
|
|
workflow_call:
|
|
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
issues: write
|
|
|
|
jobs:
|
|
lint:
|
|
name: Lint TypeScript/JavaScript Code
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
cache-dependency-path: web/package-lock.json
|
|
|
|
- name: Install dependencies
|
|
working-directory: web
|
|
run: npm ci
|
|
|
|
- name: Check formatting with Prettier
|
|
id: prettier
|
|
working-directory: web
|
|
continue-on-error: true
|
|
run: |
|
|
npm run format:check 2>&1 | tee prettier-output.txt
|
|
echo "result=${PIPESTATUS[0]}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Run ESLint
|
|
id: eslint
|
|
working-directory: web
|
|
continue-on-error: true
|
|
run: |
|
|
npm run lint 2>&1 | tee eslint-output.txt
|
|
echo "result=${PIPESTATUS[0]}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Read Prettier Output
|
|
if: always()
|
|
id: prettier-output
|
|
working-directory: web
|
|
run: |
|
|
if [ -f prettier-output.txt ]; then
|
|
echo 'content<<EOF' >> $GITHUB_OUTPUT
|
|
cat prettier-output.txt >> $GITHUB_OUTPUT
|
|
echo 'EOF' >> $GITHUB_OUTPUT
|
|
else
|
|
echo "content=No output" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Read ESLint Output
|
|
if: always()
|
|
id: eslint-output
|
|
working-directory: web
|
|
run: |
|
|
if [ -f eslint-output.txt ]; then
|
|
echo 'content<<EOF' >> $GITHUB_OUTPUT
|
|
cat eslint-output.txt >> $GITHUB_OUTPUT
|
|
echo 'EOF' >> $GITHUB_OUTPUT
|
|
else
|
|
echo "content=No output" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Report Prettier Results
|
|
if: always()
|
|
uses: ./.github/actions/lint-reporter
|
|
with:
|
|
title: 'Node.js Prettier Formatting'
|
|
lint-result: ${{ steps.prettier.outputs.result == '0' && 'success' || 'failure' }}
|
|
lint-output: ${{ steps.prettier-output.outputs.content }}
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Report ESLint Results
|
|
if: always()
|
|
uses: ./.github/actions/lint-reporter
|
|
with:
|
|
title: 'Node.js ESLint'
|
|
lint-result: ${{ steps.eslint.outputs.result == '0' && 'success' || 'failure' }}
|
|
lint-output: ${{ steps.eslint-output.outputs.content }}
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
build-and-test:
|
|
name: Build and Test
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
cache-dependency-path: web/package-lock.json
|
|
|
|
- name: Install dependencies
|
|
working-directory: web
|
|
run: npm ci
|
|
|
|
- name: Build frontend and backend
|
|
working-directory: web
|
|
run: npm run build:ci
|
|
|
|
- name: Run tests
|
|
working-directory: web
|
|
run: npm run test:ci
|
|
env:
|
|
CI: true
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: node-build-artifacts
|
|
path: |
|
|
web/dist/
|
|
web/public/bundle/
|
|
|
|
type-check:
|
|
name: TypeScript Type Checking
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
cache-dependency-path: web/package-lock.json
|
|
|
|
- name: Install dependencies
|
|
working-directory: web
|
|
run: npm ci
|
|
|
|
- name: Check TypeScript types
|
|
working-directory: web
|
|
run: npm run typecheck
|
|
|
|
audit:
|
|
name: Security Audit
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
cache-dependency-path: web/package-lock.json
|
|
|
|
- name: Run npm audit
|
|
working-directory: web
|
|
run: npm audit --audit-level=moderate || true
|
|
# || true to not fail the build on vulnerabilities, but still report them |