Skip to content

Commit

Permalink
Setup shared cache for Composer dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
coenjacobs committed Sep 8, 2024
1 parent 8c279b4 commit d21f166
Showing 1 changed file with 43 additions and 10 deletions.
53 changes: 43 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint, analyse and test
name: Lint, test and analyse

on:
push:
Expand All @@ -9,30 +9,63 @@ on:
- master

jobs:
install_dependencies:
runs-on: ubuntu-latest
name: Install dependencies
steps:
- 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
with:
path: |
./vendor/
./composer.lock
key: ${{ runner.os }}-build-composer-dependencies-${{ github.sha }}
linting:
needs: install_dependencies
runs-on: ubuntu-latest
name: Linting
steps:
- uses: actions/checkout@v3
- name: Setup dependencies
run: docker compose run --rm builder composer install
- uses: actions/cache/restore@v4
name: Restore cached dependencies
with:
path: |
./vendor/
./composer.lock
key: ${{ runner.os }}-build-composer-dependencies-${{ github.sha }}
- 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@v3
- name: Setup dependencies
run: docker compose run --rm builder composer install
- uses: actions/cache/restore@v4
name: Restore cached dependencies
with:
path: |
./vendor/
./composer.lock
key: ${{ runner.os }}-build-composer-dependencies-${{ github.sha }}
- 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@v3
- name: Setup dependencies
run: docker compose run --rm builder composer install
- uses: actions/cache/restore@v4
name: Restore cached dependencies
with:
path: |
./vendor/
./composer.lock
key: ${{ runner.os }}-build-composer-dependencies-${{ github.sha }}
- uses: actions/checkout@v4
- name: Run analysis
run: docker compose run --rm builder composer test:phpstan

0 comments on commit d21f166

Please sign in to comment.