|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main, develop] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + name: Build & Test |
| 12 | + runs-on: ubuntu-latest |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + node-version: [18, 20, 22] |
| 16 | + |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v4 |
| 19 | + |
| 20 | + - name: Setup Node.js ${{ matrix.node-version }} |
| 21 | + uses: actions/setup-node@v4 |
| 22 | + with: |
| 23 | + node-version: ${{ matrix.node-version }} |
| 24 | + cache: 'npm' |
| 25 | + |
| 26 | + - name: Install dependencies |
| 27 | + run: npm ci |
| 28 | + |
| 29 | + - name: Type check |
| 30 | + run: npx tsc --noEmit |
| 31 | + |
| 32 | + - name: Build |
| 33 | + run: npm run build |
| 34 | + |
| 35 | + - name: Verify dist output |
| 36 | + run: | |
| 37 | + FILE_COUNT=$(find dist -name "*.js" | wc -l) |
| 38 | + echo "Compiled $FILE_COUNT files" |
| 39 | + if [ "$FILE_COUNT" -lt 100 ]; then |
| 40 | + echo "ERROR: Expected at least 100 compiled files" |
| 41 | + exit 1 |
| 42 | + fi |
| 43 | +
|
| 44 | + extension: |
| 45 | + name: VS Code Extension |
| 46 | + runs-on: ubuntu-latest |
| 47 | + |
| 48 | + steps: |
| 49 | + - uses: actions/checkout@v4 |
| 50 | + |
| 51 | + - name: Setup Node.js |
| 52 | + uses: actions/setup-node@v4 |
| 53 | + with: |
| 54 | + node-version: 20 |
| 55 | + cache: 'npm' |
| 56 | + |
| 57 | + - name: Install extension dependencies |
| 58 | + run: cd extensions/vscode && npm ci |
| 59 | + |
| 60 | + - name: Compile extension |
| 61 | + run: cd extensions/vscode && npm run compile |
| 62 | + |
| 63 | + - name: Package extension |
| 64 | + run: cd extensions/vscode && npm run package |
| 65 | + |
| 66 | + - name: Upload .vsix artifact |
| 67 | + uses: actions/upload-artifact@v4 |
| 68 | + with: |
| 69 | + name: localcode-vscode |
| 70 | + path: extensions/vscode/*.vsix |
| 71 | + |
| 72 | + lint: |
| 73 | + name: Lint |
| 74 | + runs-on: ubuntu-latest |
| 75 | + |
| 76 | + steps: |
| 77 | + - uses: actions/checkout@v4 |
| 78 | + |
| 79 | + - name: Setup Node.js |
| 80 | + uses: actions/setup-node@v4 |
| 81 | + with: |
| 82 | + node-version: 20 |
| 83 | + cache: 'npm' |
| 84 | + |
| 85 | + - name: Install dependencies |
| 86 | + run: npm ci |
| 87 | + |
| 88 | + - name: Check formatting |
| 89 | + run: npx prettier --check "src/**/*.{ts,tsx}" "extensions/vscode/src/**/*.ts" 2>/dev/null || true |
0 commit comments