-
Notifications
You must be signed in to change notification settings - Fork 83
96 lines (79 loc) · 2.53 KB
/
Copy pathpresubmit.yml
File metadata and controls
96 lines (79 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: gcloud MCP Server CI
on:
push:
branches: [main, release]
pull_request:
branches: [main, release]
merge_group:
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
permissions:
contents: read # For checkout
steps:
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Set up Node.js
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm ci
- name: Run lint
run: |
npm run fix
git diff --exit-code
- name: Build project
run: npm run build
test:
name: Test (Node ${{ matrix.node-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
needs: lint
permissions:
contents: read # For checkout
strategy:
fail-fast: false # So we can see all test failures
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: ['20.x', '22.x', '24.x']
steps:
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- name: Run unit tests
run: npm run test:i
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db' # v3
with:
version: '>= 530.0.0'
- name: Run integration tests
run: npm run test:integration --workspace packages/gcloud-mcp
coverage:
if: github.actor != 'dependabot[bot]'
name: Coverage
runs-on: ubuntu-latest
needs: test
permissions:
contents: read # For checkout
steps:
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Set up Node.js
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm run test:i
- name: Upload coverage report
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true