Skip to content

Instantly share code, notes, and snippets.

@freekmurze
Created May 8, 2020 21:00
Show Gist options
  • Save freekmurze/ad30fd53e4a0b642900c6e268e3b265b to your computer and use it in GitHub Desktop.
Save freekmurze/ad30fd53e4a0b642900c6e268e3b265b to your computer and use it in GitHub Desktop.
Run psalm on GitHub Actions
name: Psalm
on:
push:
paths:
- '**.php'
- 'psalm.xml'
jobs:
psalm:
name: Psalm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none
- name: Create database
run: |
sudo /etc/init.d/mysql start
mysql -u root -proot -e 'CREATE DATABASE IF NOT EXISTS app_database;'
- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: vendor
key: composer-${{ hashFiles('composer.lock') }}
- name: Run composer install
run: composer install -n --prefer-dist
- name: Prepare Laravel Application
run: |
cp .env.ci .env
php artisan key:generate
php artisan migrate
- name: Generate IDE helper files
run: |
php artisan ide-helper:eloquent
php artisan ide-helper:generate
php artisan ide-helper:meta
php artisan ide-helper:models
- name: Run psalm
run: ./vendor/bin/psalm -c psalm.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment