diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 8761028b..00a3e00a 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -4,7 +4,7 @@ on: - pull_request jobs: test: - uses: adonisjs/.github/.github/workflows/test.yml@main + uses: adonisjs/core/.github/workflows/test.yml@next lint: uses: adonisjs/.github/.github/workflows/lint.yml@main diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..c584e07e --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,70 @@ +on: + workflow_call: + inputs: + disable-windows: + description: Disable running tests on Windows + type: boolean + default: false + required: false + inputs: + install-pnpm: + description: Install pnpm before running tests + type: boolean + default: false + required: false + +jobs: + test_linux: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18.16.0, 20.x] + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Install pnpm + if: ${{ inputs.install-pnpm }} + uses: pnpm/action-setup@v2 + with: + version: 8.6.3 + + - name: Install dependencies + run: npm install + + - name: Run tests + run: npm test + + test_windows: + if: ${{ !inputs.disable-windows }} + runs-on: windows-latest + strategy: + matrix: + node-version: [18.16.0, 20.x] + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Install pnpm + if: ${{ inputs.install-pnpm }} + uses: pnpm/action-setup@v2 + with: + version: 8.6.3 + + - name: Install dependencies + run: npm install + + - name: Run tests + run: npm test