Skip to content

Commit

Permalink
Added cache to pnpm in action
Browse files Browse the repository at this point in the history
Separated out build scripts in action
  • Loading branch information
Joery-M committed Mar 26, 2024
1 parent e3f056d commit 7a59fa9
Showing 1 changed file with 36 additions and 15 deletions.
51 changes: 36 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ name: Test

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]

jobs:
test:

runs-on: self-hosted

strategy:
Expand All @@ -20,20 +19,42 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/[email protected]
with:
version: 8 # Latest major


- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm

- run: pnpm install

- run: pnpm build

- run: pnpm test
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8 # Latest major
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Build Darkroom
run: pnpm build:darkroom

- name: Build Timeline
run: pnpm build:timeline

- name: Build safelight
run: pnpm build:safelight

- name: Test
run: pnpm test

0 comments on commit 7a59fa9

Please sign in to comment.