MichaelHorwitz at schedule event #513
This file contains 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: Jest-Test | |
run-name: ${{ github.actor }} at ${{ github.event_name }} event | |
on: | |
workflow_dispatch: | |
fork: | |
pull_request: | |
branches: | |
- release | |
- dev | |
- main | |
types: | |
- opened | |
- reopened | |
- edited | |
- synchronize | |
schedule: | |
- cron: '43 3 * * *' | |
jobs: | |
jest-test: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: frontend | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Cache Node modules | |
uses: actions/cache@v3 | |
with: | |
path: | | |
frontend/node_modules | |
~/.cache/yarn | |
key: yarn-${{ hashFiles('frontend/package.json') }} | |
restore-keys: | | |
yarn-${{ hashFiles('frontend/package.json') }} | |
yarn- | |
- name: Run install | |
uses: borales/actions-yarn@v5 | |
with: | |
cmd: install | |
dir: 'frontend' | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # if needed | |
- run: yarn install --frozen-lockfile | |
- uses: nrwl/nx-set-shas@v4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: pwd | |
- run: yarn nx affected -t test || yarn nx reset | yarn nx affected -t test || yarn jest test --coverage | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |