Last active
December 17, 2022 19:27
-
-
Save Wellers0n/6c8156f69a7c7028905539f4cb935895 to your computer and use it in GitHub Desktop.
pull-request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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