Skip to content

Commit

Permalink
feat: add node module caching to web_ci_workflow, start unit_ci_workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dallen4 committed Jan 11, 2025
1 parent ca16459 commit 411b5fd
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/unit_ci_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Unit Tests

on:
pull_request:
push:
branches: [main, alpha]

jobs:
test:
runs-on: macos-latest

permissions:
# Required to checkout the code
contents: read
# Required to put a comment into the pull-request
pull-requests: write

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/cache@v4
id: cache-node-modules
with:
path: |
./node_modules
./web/node_modules
./cli/node_modules
./worker/node_modules
./shared/node_modules
key: ${{ runner.os }}-${{ hashFiles('./yarn.lock') }}
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: Run Unit Tests
run: CI="true" yarn test:cov
- name: Report Coverage
if: github.event_name == 'pull_request'
uses: davelosert/vitest-coverage-report-action@v2
11 changes: 11 additions & 0 deletions .github/workflows/web_ci_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,18 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/cache@v4
id: cache-node-modules
with:
path: |
./node_modules
./web/node_modules
./cli/node_modules
./worker/node_modules
./shared/node_modules
key: ${{ runner.os }}-${{ hashFiles('./yarn.lock') }}
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: Install Playwright Browsers
run: yarn web playwright install --with-deps
Expand Down

0 comments on commit 411b5fd

Please sign in to comment.