diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..b7549af --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,33 @@ +name: Jest + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +env: + WORKING_DIRECTORY: application + +jobs: + Test: + name: Run test codes + if: | + github.event.pull_request.draft == false + && !startsWith(github.head_ref, 'release') + && !startsWith(github.head_ref, 'doc') + runs-on: ubuntu-latest + defaults: + run: + working-directory: ${{ env.WORKING_DIRECTORY }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install and cache nodejs + uses: actions/setup-node@v3 + with: + node-version-file: ${{ env.WORKING_DIRECTORY }}/package.json + cache: 'npm' + cache-dependency-path: '**/package-lock.json' + - name: Install packages + run: npm ci + - name: Show coverage + run: npm test -- --bail --maxWorkers=100% --watchAll=false --coverage \ No newline at end of file