Skip to content

Commit

Permalink
fix(ci): add missing pnpm install step
Browse files Browse the repository at this point in the history
  • Loading branch information
BoscoDomingo committed Jul 27, 2024
1 parent 0c8fb30 commit 815ba93
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 51 deletions.
107 changes: 56 additions & 51 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,56 @@
name: Format code

on:
pull_request:
branches:
- main
- develop

jobs:
format:
runs-on: ubuntu-latest
permissions:
# To commit and push the changed files
contents: write

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"

# Alternative
# - name: Cache node modules
# uses: actions/cache@v3
# env:
# cache-name: cache-node-modules
# with:
# path: ~/.pnpm-store
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-

- name: Install Dependencies
run: pnpm i --frozen-lockfile

- name: Run format
run: pnpm format

# Source: https://github.com/marketplace/actions/git-auto-commit
- id: auto-commit-changes
name: "Auto commit changes"
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "style(auto): formatting"
skip_dirty_check: false
name: Format code

on:
pull_request:
branches:
- main
- develop

jobs:
format:
runs-on: ubuntu-latest
permissions:
# To commit and push the changed files
contents: write

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: latest

- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"

# Alternative
# - name: Cache node modules
# uses: actions/cache@v3
# env:
# cache-name: cache-node-modules
# with:
# path: ~/.pnpm-store
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-

- name: Install Dependencies
run: pnpm i --frozen-lockfile

- name: Run format
run: pnpm format

# Source: https://github.com/marketplace/actions/git-auto-commit
- id: auto-commit-changes
name: "Auto commit changes"
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "style(auto): formatting"
skip_dirty_check: false
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: latest

- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
Expand Down

0 comments on commit 815ba93

Please sign in to comment.