Skip to content

Commit

Permalink
refactor test workflow to be reusable
Browse files Browse the repository at this point in the history
  • Loading branch information
htrinter committed Nov 26, 2023
1 parent be25804 commit d09af53
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/action-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: Run tests
on: [push, pull_request]
jobs:
call-test-workflow:
uses: ./.github/workflows/test-workflow.yml
with:
node-version: '18'
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: Run tests
on: [push, pull_request]
name: Test Workflow
on:
workflow_call:
inputs:
node-version:
required: true
type: string
jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -8,7 +13,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
node-version: ${{ inputs.node-version }}
- name: Cache dependencies
id: cache
uses: actions/cache@v2
Expand All @@ -25,4 +30,4 @@ jobs:
- name: Format-check
run: npm run format:check
- name: Run tests
run: npm run test:unit
run: npm run test:unit

0 comments on commit d09af53

Please sign in to comment.