Skip to content

Commit b5a7f64

Browse files
committed
Clean up and prepare docs/pipeline
1 parent 164aba2 commit b5a7f64

File tree

4 files changed

+509
-1
lines changed

4 files changed

+509
-1
lines changed

.github/workflows/full_test.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Full Test
2+
on:
3+
pull_request:
4+
types: [opened, synchronize]
5+
6+
env:
7+
INTEGRATION_TEST_SPREADSHEET_ID: ${{ secrets.INTEGRATION_TEST_SPREADSHEET_ID }}
8+
INTEGRATION_TEST_AUTH_JSON: ${{ secrets.INTEGRATION_TEST_AUTH_JSON }}
9+
10+
jobs:
11+
full_test:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
node-version: ['22.x'] # Can expand if needed
16+
17+
if: github.event.review.state == 'approved' || github.event.pull_request.user.login == 'edocsss'
18+
19+
steps:
20+
- uses: actions/checkout@v3
21+
with:
22+
ref: ${{ github.head_ref }}
23+
24+
- name: Dump GitHub context
25+
env:
26+
GITHUB_CONTEXT: ${{ toJson(github) }}
27+
run: echo "$GITHUB_CONTEXT"
28+
29+
- name: Setup Node.js ${{ matrix.node-version }}
30+
uses: actions/setup-node@v3
31+
with:
32+
node-version: ${{ matrix.node-version }}
33+
cache: 'npm'
34+
35+
- name: Install dependencies
36+
run: npm ci
37+
38+
- name: Compile TypeScript
39+
run: npx tsc --noEmit
40+
41+
- name: Run Unit Tests with Coverage
42+
run: |
43+
npm run test -- --coverage
44+
cp coverage/lcov.info coverage.out
45+
46+
- name: Generate Coverage Badge
47+
uses: tj-actions/coverage-badge-js@v1
48+
with:
49+
green: 80
50+
coverage-summary-path: coverage/coverage-summary.json
51+
52+
- name: Add Coverage Badge
53+
uses: stefanzweifel/git-auto-commit-action@v4
54+
id: auto-commit-action
55+
with:
56+
commit_message: Apply Code Coverage Badge
57+
skip_fetch: true
58+
skip_checkout: true
59+
file_pattern: ./README.md
60+
61+
- name: Push Changes
62+
if: steps.auto-commit-action.outputs.changes_detected == 'true'
63+
uses: ad-m/github-push-action@master
64+
with:
65+
github_token: ${{ github.token }}
66+
branch: ${{ github.head_ref }}

.github/workflows/unit_test.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Unit Test
2+
on: push
3+
4+
jobs:
5+
unit_test:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
node-version: ['18.x', '20.x', '22.x']
10+
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- name: Setup Node.js ${{ matrix.node-version }}
15+
uses: actions/setup-node@v3
16+
with:
17+
node-version: ${{ matrix.node-version }}
18+
cache: 'npm'
19+
20+
- name: Install dependencies
21+
run: npm ci
22+
23+
- name: TypeScript compile check (optional)
24+
run: npx tsc --noEmit
25+
26+
- name: Run unit tests
27+
run: npm test

0 commit comments

Comments
 (0)