|
1 | | -name: CI |
2 | | - |
3 | | -on: |
4 | | - push: |
5 | | - branches: [main, master] |
6 | | - pull_request: |
7 | | - branches: [main, master] |
8 | | - |
9 | | -jobs: |
10 | | - lint: |
11 | | - name: Lint |
12 | | - runs-on: ubuntu-latest |
13 | | - steps: |
14 | | - - uses: actions/checkout@v4 |
15 | | - |
16 | | - - name: Setup Node.js |
17 | | - uses: actions/setup-node@v4 |
18 | | - with: |
19 | | - node-version: '20' |
20 | | - cache: 'npm' |
21 | | - |
22 | | - - name: Install dependencies |
23 | | - run: npm ci |
24 | | - |
25 | | - - name: Run ESLint |
26 | | - run: npm run lint |
27 | | - |
28 | | - - name: Check formatting |
29 | | - run: npx prettier --check "src/**/*.ts" "tests/**/*.ts" "examples/**/*.ts" |
30 | | - |
31 | | - typecheck: |
32 | | - name: Type Check |
33 | | - runs-on: ubuntu-latest |
34 | | - steps: |
35 | | - - uses: actions/checkout@v4 |
36 | | - |
37 | | - - name: Setup Node.js |
38 | | - uses: actions/setup-node@v4 |
39 | | - with: |
40 | | - node-version: '20' |
41 | | - cache: 'npm' |
42 | | - |
43 | | - - name: Install dependencies |
44 | | - run: npm ci |
45 | | - |
46 | | - - name: Run TypeScript compiler |
47 | | - run: npm run typecheck |
48 | | - |
49 | | - build: |
50 | | - name: Build |
51 | | - runs-on: ubuntu-latest |
52 | | - steps: |
53 | | - - uses: actions/checkout@v4 |
54 | | - |
55 | | - - name: Setup Node.js |
56 | | - uses: actions/setup-node@v4 |
57 | | - with: |
58 | | - node-version: '20' |
59 | | - cache: 'npm' |
60 | | - |
61 | | - - name: Install dependencies |
62 | | - run: npm ci |
63 | | - |
64 | | - - name: Build package |
65 | | - run: npm run build |
66 | | - |
67 | | - - name: Check build output |
68 | | - run: | |
69 | | - test -f dist/index.js || exit 1 |
70 | | - test -f dist/index.mjs || exit 1 |
71 | | - test -f dist/index.d.ts || exit 1 |
72 | | -
|
73 | | - test: |
74 | | - name: Test (Node ${{ matrix.node-version }}) |
75 | | - runs-on: ubuntu-latest |
76 | | - strategy: |
77 | | - matrix: |
78 | | - node-version: [20, 22] |
79 | | - steps: |
80 | | - - uses: actions/checkout@v4 |
81 | | - |
82 | | - - name: Setup Node.js ${{ matrix.node-version }} |
83 | | - uses: actions/setup-node@v4 |
84 | | - with: |
85 | | - node-version: ${{ matrix.node-version }} |
86 | | - cache: 'npm' |
87 | | - |
88 | | - - name: Install dependencies |
89 | | - run: npm ci |
90 | | - |
91 | | - - name: Run unit tests |
92 | | - run: npm run test |
93 | | - |
94 | | - - name: Generate coverage report |
95 | | - if: matrix.node-version == 20 |
96 | | - run: npm run test:coverage |
97 | | - |
98 | | - - name: Upload coverage to Codecov |
99 | | - if: matrix.node-version == 20 |
100 | | - uses: codecov/codecov-action@v4 |
101 | | - with: |
102 | | - files: ./coverage/coverage-final.json |
103 | | - flags: unittests |
104 | | - name: codecov-agi-node |
105 | | - env: |
106 | | - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
107 | | - |
108 | | - all-checks: |
109 | | - name: All Checks Passed |
110 | | - if: always() |
111 | | - needs: [lint, typecheck, build, test] |
112 | | - runs-on: ubuntu-latest |
113 | | - steps: |
114 | | - - name: Check all jobs |
115 | | - run: | |
116 | | - if [ "${{ needs.lint.result }}" != "success" ] || \ |
117 | | - [ "${{ needs.typecheck.result }}" != "success" ] || \ |
118 | | - [ "${{ needs.build.result }}" != "success" ] || \ |
119 | | - [ "${{ needs.test.result }}" != "success" ]; then |
120 | | - echo "One or more checks failed" |
121 | | - exit 1 |
122 | | - fi |
123 | | - echo "All checks passed!" |
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main, master] |
| 6 | + pull_request: |
| 7 | + branches: [main, master] |
| 8 | + |
| 9 | +jobs: |
| 10 | + lint: |
| 11 | + name: Lint |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v4 |
| 15 | + |
| 16 | + - name: Setup Node.js |
| 17 | + uses: actions/setup-node@v4 |
| 18 | + with: |
| 19 | + node-version: '20' |
| 20 | + cache: 'npm' |
| 21 | + |
| 22 | + - name: Install dependencies |
| 23 | + run: npm ci |
| 24 | + |
| 25 | + - name: Run ESLint |
| 26 | + run: npm run lint |
| 27 | + |
| 28 | + - name: Check formatting |
| 29 | + run: npx prettier --check "src/**/*.ts" "tests/**/*.ts" "examples/**/*.ts" |
| 30 | + |
| 31 | + typecheck: |
| 32 | + name: Type Check |
| 33 | + runs-on: ubuntu-latest |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@v4 |
| 36 | + |
| 37 | + - name: Setup Node.js |
| 38 | + uses: actions/setup-node@v4 |
| 39 | + with: |
| 40 | + node-version: '20' |
| 41 | + cache: 'npm' |
| 42 | + |
| 43 | + - name: Install dependencies |
| 44 | + run: npm ci |
| 45 | + |
| 46 | + - name: Run TypeScript compiler |
| 47 | + run: npm run typecheck |
| 48 | + |
| 49 | + build: |
| 50 | + name: Build |
| 51 | + runs-on: ubuntu-latest |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@v4 |
| 54 | + |
| 55 | + - name: Setup Node.js |
| 56 | + uses: actions/setup-node@v4 |
| 57 | + with: |
| 58 | + node-version: '20' |
| 59 | + cache: 'npm' |
| 60 | + |
| 61 | + - name: Install dependencies |
| 62 | + run: npm ci |
| 63 | + |
| 64 | + - name: Build package |
| 65 | + run: npm run build |
| 66 | + |
| 67 | + - name: Check build output |
| 68 | + run: | |
| 69 | + test -f dist/index.js || exit 1 |
| 70 | + test -f dist/index.mjs || exit 1 |
| 71 | + test -f dist/index.d.ts || exit 1 |
| 72 | +
|
| 73 | + test: |
| 74 | + name: Test (Node ${{ matrix.node-version }}) |
| 75 | + runs-on: ubuntu-latest |
| 76 | + strategy: |
| 77 | + matrix: |
| 78 | + node-version: [20, 22] |
| 79 | + steps: |
| 80 | + - uses: actions/checkout@v4 |
| 81 | + |
| 82 | + - name: Setup Node.js ${{ matrix.node-version }} |
| 83 | + uses: actions/setup-node@v4 |
| 84 | + with: |
| 85 | + node-version: ${{ matrix.node-version }} |
| 86 | + cache: 'npm' |
| 87 | + |
| 88 | + - name: Install dependencies |
| 89 | + run: npm ci |
| 90 | + |
| 91 | + - name: Run unit tests |
| 92 | + run: npm run test |
| 93 | + |
| 94 | + - name: Generate coverage report |
| 95 | + if: matrix.node-version == 20 |
| 96 | + run: npm run test:coverage |
| 97 | + |
| 98 | + - name: Upload coverage to Codecov |
| 99 | + if: matrix.node-version == 20 |
| 100 | + uses: codecov/codecov-action@v4 |
| 101 | + with: |
| 102 | + files: ./coverage/coverage-final.json |
| 103 | + flags: unittests |
| 104 | + name: codecov-agi-node |
| 105 | + env: |
| 106 | + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
| 107 | + |
| 108 | + all-checks: |
| 109 | + name: All Checks Passed |
| 110 | + if: always() |
| 111 | + needs: [lint, typecheck, build, test] |
| 112 | + runs-on: ubuntu-latest |
| 113 | + steps: |
| 114 | + - name: Check all jobs |
| 115 | + run: | |
| 116 | + if [ "${{ needs.lint.result }}" != "success" ] || \ |
| 117 | + [ "${{ needs.typecheck.result }}" != "success" ] || \ |
| 118 | + [ "${{ needs.build.result }}" != "success" ] || \ |
| 119 | + [ "${{ needs.test.result }}" != "success" ]; then |
| 120 | + echo "One or more checks failed" |
| 121 | + exit 1 |
| 122 | + fi |
| 123 | + echo "All checks passed!" |
0 commit comments