Created
February 6, 2021 09:14
-
-
Save roberto-butti/f6bdc01e30fa4742a386dc5eeb48a1b4 to your computer and use it in GitHub Desktop.
snippet for githubactions workflow with node_modules caching
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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