0

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?

João Pimentel Ferreira
  • 14,289
  • 10
  • 80
  • 109

1 Answers1

0

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
João Pimentel Ferreira
  • 14,289
  • 10
  • 80
  • 109