Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/full_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Full Test
on:
pull_request:
types: [opened, synchronize]

env:
INTEGRATION_TEST_SPREADSHEET_ID: ${{ secrets.INTEGRATION_TEST_SPREADSHEET_ID }}
INTEGRATION_TEST_AUTH_JSON: ${{ secrets.INTEGRATION_TEST_AUTH_JSON }}

jobs:
full_test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['22.x'] # Can expand if needed

if: github.event.review.state == 'approved' || github.event.pull_request.user.login == 'edocsss'

steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Compile TypeScript
run: npx tsc --noEmit

- name: Run Unit Tests with Coverage
run: |
npm run test -- --coverage
cp coverage/lcov.info coverage.out

- name: Generate Coverage Badge
uses: tj-actions/coverage-badge-js@v1
with:
green: 80
coverage-summary-path: coverage/coverage-summary.json

- name: Add Coverage Badge
uses: stefanzweifel/git-auto-commit-action@v4
id: auto-commit-action
with:
commit_message: Apply Code Coverage Badge
skip_fetch: true
skip_checkout: true
file_pattern: ./README.md

- name: Push Changes
if: steps.auto-commit-action.outputs.changes_detected == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ github.token }}
branch: ${{ github.head_ref }}
27 changes: 27 additions & 0 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Unit Test
on: push

jobs:
unit_test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['18.x', '20.x', '22.x']

steps:
- uses: actions/checkout@v3

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: TypeScript compile check (optional)
run: npx tsc --noEmit

- name: Run unit tests
run: npm test
Loading
Loading