Skip to content

Commit

Permalink
chore/add pr-test-action
Browse files Browse the repository at this point in the history
  • Loading branch information
ishiko732 committed Nov 20, 2023
1 parent 899e7f6 commit 4a5495e
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: PR Test

on:
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 16

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run tests
run: pnpm test

- name: jest coverage report
uses: ArtiomTr/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Check test status
id: test-status
run: echo "::set-output name=status::$(if grep -q 'Test failed' test-results.txt; then echo 'failure'; else echo 'success'; fi)"

merge:
needs: test
runs-on: ubuntu-latest
if: ${{ needs.test.outputs.status == 'success' }}

steps:
- name: Checkout code
uses: actions/checkout@v2

0 comments on commit 4a5495e

Please sign in to comment.