Improve tooling, checks and workflows #205
Workflow file for this run
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: Lint, test and analyse | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
install_dependencies: | |
runs-on: ubuntu-latest | |
name: Install dependencies | |
steps: | |
- uses: actions/cache/restore@v4 | |
name: Restore cached dependencies | |
env: | |
cache-name: cache-composer-dependencies | |
with: | |
path: | | |
./vendor/ | |
./composer.lock | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
- ${{ runner.os }}-build-${{ env.cache-name }}- | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: docker compose run --rm builder composer install | |
- name: Cache installed dependencies | |
id: cache-composer-dependencies | |
uses: actions/cache/save@v4 | |
env: | |
cache-name: cache-composer-dependencies | |
with: | |
path: | | |
./vendor/ | |
./composer.lock | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }} | |
linting: | |
needs: install_dependencies | |
runs-on: ubuntu-latest | |
name: Linting | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run linting | |
run: docker compose run --rm builder composer test:lint | |
testing: | |
needs: install_dependencies | |
runs-on: ubuntu-latest | |
name: Testing | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run testing | |
run: docker compose run --rm builder composer test:phpunit | |
analysis: | |
needs: install_dependencies | |
runs-on: ubuntu-latest | |
name: Analysis | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run analysis | |
run: docker compose run --rm builder composer test:phpstan |