Skip to content

Instantly share code, notes, and snippets.

@Wellers0n
Last active December 17, 2022 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Wellers0n/6c8156f69a7c7028905539f4cb935895 to your computer and use it in GitHub Desktop.
Save Wellers0n/6c8156f69a7c7028905539f4cb935895 to your computer and use it in GitHub Desktop.
pull-request
name: ci
on:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
- uses: actions/cache@v3
id: yarn-cache
with:
path: "**/node_modules"
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn --frozen-lockfile
- name: Run Linter
run: yarn lint
- name: Generate Test Coverage
uses: ArtiomTr/jest-coverage-report-action@v2
id: coverage
with:
package-manager: yarn
github-token: '${{ secrets.GITHUB_TOKEN }}'
output: report-markdown
test-script: 'yarn test:coverage'
- name: Comment Test Coverage
uses: marocchino/sticky-pull-request-comment@v2
with:
message: ${{ steps.coverage.outputs.report }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment