forked from JayPNanduri/ast-cli-javascript-wrapper-jay
-
Notifications
You must be signed in to change notification settings - Fork 3
62 lines (58 loc) · 2.41 KB
/
Copy pathci.yml
File metadata and controls
62 lines (58 loc) · 2.41 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
name: AST Javascript wrapper CI
on: [ pull_request ]
permissions:
contents: read
jobs:
unit-tests:
runs-on: cx-public-ubuntu-x64
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Verify single lockfile (Step 0 - Supply Chain Policy)
run: |
if [ -f yarn.lock ] && [ -f package-lock.json ]; then
echo "❌ ERROR: Both yarn.lock and package-lock.json found. Policy requires exactly ONE package manager. Allowed: npm + package-lock.json OR Yarn + yarn.lock"
exit 1
fi
if [ ! -f yarn.lock ] && [ ! -f package-lock.json ]; then
echo "❌ ERROR: No lockfile found. Policy requires exactly ONE package manager lockfile. Required: npm + package-lock.json OR Yarn + yarn.lock"
exit 1
fi
- name: Use Node.js 22.11.0
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 22.11.0
registry-url: https://npm.pkg.github.com/
- run: npm ci --ignore-scripts
- name: Run Unit Tests
run: npm run test:unit
integration-tests:
runs-on: cx-public-ubuntu-x64
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Verify single lockfile (Step 0 - Supply Chain Policy)
run: |
if [ -f yarn.lock ] && [ -f package-lock.json ]; then
echo "❌ ERROR: Both yarn.lock and package-lock.json found. Policy requires exactly ONE package manager. Allowed: npm + package-lock.json OR Yarn + yarn.lock"
exit 1
fi
if [ ! -f yarn.lock ] && [ ! -f package-lock.json ]; then
echo "❌ ERROR: No lockfile found. Policy requires exactly ONE package manager lockfile. Required: npm + package-lock.json OR Yarn + yarn.lock"
exit 1
fi
- name: Use Node.js 22.11.0
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 22.11.0
registry-url: https://npm.pkg.github.com/
- run: npm ci --ignore-scripts
- name: Code Linting
run: npm run lint
- run: npm run build --if-present
- name: Run tests
env:
CX_CLIENT_ID: ${{ secrets.CX_CLIENT_ID}}
CX_CLIENT_SECRET: ${{ secrets.CX_CLIENT_SECRET}}
CX_BASE_URI: ${{ secrets.CX_BASE_URI }}
CX_TENANT: ${{ secrets.CX_TENANT }}
CX_APIKEY: ${{ secrets.CX_APIKEY }}
run: npm test