Skip to content

Commit 1d858db

Browse files
committed
ci: script
1 parent 0720066 commit 1d858db

2 files changed

Lines changed: 53 additions & 53 deletions

File tree

.github/workflows/ci.yml

Lines changed: 33 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main, develop ]
5+
branches: [main, develop]
66
pull_request:
7-
branches: [ main, develop ]
7+
branches: [main, develop]
88

99
jobs:
1010
test:
@@ -15,37 +15,34 @@ jobs:
1515
node-version: [20.x, 22.x]
1616

1717
steps:
18-
- uses: actions/checkout@v4
19-
20-
- name: Use 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: Verify repo contents (debug)
27-
run: |
28-
echo "pwd=$(pwd)"
29-
ls -la
30-
echo "src exists?"; ls -la src || true
31-
echo "tests:"; ls -la src/__tests__ src/**/__tests__ 2>/dev/null || true
32-
33-
- name: Install dependencies
34-
run: npm ci
35-
36-
- name: Run linter
37-
run: npm run lint
38-
39-
- name: Run tests
40-
run: npm test
41-
42-
- name: Build
43-
run: npm run build
44-
45-
- name: Upload coverage
46-
uses: codecov/codecov-action@v3
47-
if: matrix.node-version == '20.x'
48-
with:
49-
files: ./coverage/lcov.info
50-
flags: unittests
51-
name: codecov-umbrella
18+
- uses: actions/checkout@v4
19+
20+
- name: Use 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: Verify repo contents (debug)
27+
run: |
28+
echo "pwd=$(pwd)"
29+
ls -la
30+
echo "src exists?"; ls -la src || true
31+
echo "tests:"; ls -la src/__tests__ src/**/__tests__ 2>/dev/null || true
32+
33+
- name: Install dependencies
34+
run: npm ci
35+
36+
- name: Run linter
37+
run: npm run lint
38+
39+
- name: Run tests
40+
run: npm test
41+
42+
- name: Build
43+
run: npm run build
44+
45+
- name: Upload coverage reports to Codecov
46+
uses: codecov/codecov-action@v5
47+
with:
48+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/publish.yml

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,30 @@ on:
77
jobs:
88
publish:
99
runs-on: ubuntu-latest
10+
permissions:
11+
id-token: write
12+
contents: read
1013

1114
steps:
12-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v4
1316

14-
- uses: actions/setup-node@v4
15-
with:
16-
node-version: '20.x'
17-
registry-url: 'https://registry.npmjs.org'
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: "20.x"
20+
registry-url: "https://registry.npmjs.org"
1821

19-
- name: Install dependencies
20-
run: npm ci
22+
- name: Install dependencies
23+
run: npm ci
2124

22-
- name: Verify npm auth (debug)
23-
run: npm whoami
24-
env:
25-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
25+
- name: Verify npm auth (debug)
26+
run: npm whoami
27+
env:
28+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2629

27-
- name: Build
28-
run: npm run build
30+
- name: Build
31+
run: npm run build
2932

30-
- name: Publish to NPM
31-
run: npm publish --provenance --access public
32-
env:
33-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
33+
- name: Publish to NPM
34+
run: npm publish --provenance --access public
35+
env:
36+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)