Skip to content

Instantly share code, notes, and snippets.

@roberto-butti
Created February 6, 2021 09:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roberto-butti/f6bdc01e30fa4742a386dc5eeb48a1b4 to your computer and use it in GitHub Desktop.
Save roberto-butti/f6bdc01e30fa4742a386dc5eeb48a1b4 to your computer and use it in GitHub Desktop.
snippet for githubactions workflow with node_modules caching
name: Test Laravel Github action
on:
push:
branches:
- main
- develop
- features/**
jobs:
laravel-tests:
runs-on: ubuntu-latest
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: [ '8.0' ]
dependency-stability: [ prefer-stable ]
name: P${{ matrix.php-versions }} - L${{ matrix.laravel }} - ${{ matrix.dependency-stability }} - ${{ matrix.operating-system}}
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Cache node_modules directory
uses: actions/cache@v2
id: node_modules-cache
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }}
- name: Install NPM packages
if: steps.node_modules-cache.outputs.cache-hit != 'true'
run: npm ci
- name: Build frontend
run: npm run development
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment