diff --git a/.github/workflows/action-test.yml b/.github/workflows/action-test.yml new file mode 100644 index 0000000..5957b7e --- /dev/null +++ b/.github/workflows/action-test.yml @@ -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' diff --git a/.github/workflows/github-actions-test.yml b/.github/workflows/test-workflow.yml similarity index 77% rename from .github/workflows/github-actions-test.yml rename to .github/workflows/test-workflow.yml index 749f7b0..06fc319 100644 --- a/.github/workflows/github-actions-test.yml +++ b/.github/workflows/test-workflow.yml @@ -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 @@ -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 @@ -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 \ No newline at end of file