Skip to content

Commit

Permalink
chore: create main merge actions
Browse files Browse the repository at this point in the history
Updated pull-request jobs to write test coverage in comments
  • Loading branch information
jp-prud authored Oct 9, 2023
1 parent 8bf1041 commit bd4fe6f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/merge-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@ jobs:
with:
node-version: ^16

- uses: actions/cache@v2
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn --frozen-lockfile

- name: Run Jest tests
Expand Down
30 changes: 22 additions & 8 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
name: ci

on:
pull_request
pull_request:

jobs:
build:
permissions: write-all
name: ci
environment: dev
runs-on: ubuntu-latest


env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -17,16 +19,28 @@ jobs:
with:
fetch-depth: 0

- name: Setup node
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ^16

- name: Install dependencies
run: yarn --frozen-lockfile --prefer-offline
- uses: actions/cache@v2
id: yarn-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Run Jest tests
run: yarn test
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn --frozen-lockfile

- name: Run ESLint
- name: Run Linter
run: yarn lint

- name: Comment with Test Coverage
uses: dkershner6/jest-coverage-commenter-action@v1
with:
github_token: '${{ secrets.GITHUB_TOKEN }}'
test_command: 'yarn test:coverage'

0 comments on commit bd4fe6f

Please sign in to comment.