1

I have the following Github CI

name: Node.js CI

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

jobs:
  build:
    strategy:
      matrix:
        platform: [ubuntu-latest, macos-latest, windows-latest]
        node-version: [12.x, 14.x, 16.x]
        
    runs-on: ${{ matrix.platform }}

    steps:
    - uses: actions/checkout@v2
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v2
      with:
        node-version: ${{ matrix.node-version }}
        cache: 'npm'
    - name: Upgrade NPM
      run: npm install -g npm
    - run: npm ci
    - run: npm test

But it doesn't work after I have installed git-lfs, I guess because I have some files only stored in Git LFS storage, and thus the npm test suite does not work

How can I integrate git-lfs with Github CI?

1 Answer 1

2

Found the solution, I needed to checkout node with v3 and use the flag lfs to true

name: Node.js CI

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

jobs:
  build:
    strategy:
      matrix:
        platform: [ubuntu-latest, macos-latest, windows-latest]
        node-version: [12.x, 14.x, 16.x]
        
    runs-on: ${{ matrix.platform }}

    steps:
    - uses: actions/checkout@v3
      with:
        lfs: true
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v2
      with:
        node-version: ${{ matrix.node-version }}
        cache: 'npm'
    - name: Upgrade NPM
      run: npm install -g npm
    - run: npm ci
    - run: npm test
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.