diff --git a/.github/workflows/_test.yml b/.github/workflows/_test.yml new file mode 100644 index 00000000..2c92db1a --- /dev/null +++ b/.github/workflows/_test.yml @@ -0,0 +1,29 @@ +name: _test +on: + workflow_dispatch: + pull_request: + types: [opened, synchronize, reopened, edited] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 2 + - uses: tj-actions/changed-files@v19 + id: files + with: + files: sites/**/*.config.js + - uses: actions/setup-node@v2 + if: ${{ !env.ACT && steps.files.outputs.any_changed == 'true' }} + with: + node-version: '14' + cache: 'npm' + - name: test + if: steps.files.outputs.any_changed == 'true' + run: | + npm install + npm test