Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update(github) Update github workflows, use composer caches #101

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 44 additions & 32 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,51 @@
name: "Continuous Integration"

on:
push:
branches:
- master
pull_request:
push:
branches:
- master
pull_request:

env:
fail-fast: true
fail-fast: true

jobs:
tests:
name: "Doctrine1 Tests"
runs-on: "ubuntu-22.04"

strategy:
matrix:
php-version:
- "7.4"
- "8.0"
- "8.1"
- "8.2"

steps:
- name: "Checkout"
uses: "actions/checkout@v3"

- name: "Install PHP"
uses: "shivammathur/[email protected]"
with:
php-version: "${{ matrix.php-version }}"
# extensions: "${{ matrix.extension }}"

- name: "Install dependencies with Composer"
uses: "ramsey/[email protected]"

- name: "Run Tests"
run: "cd tests && php run.php"
tests:
name: "Doctrine1 Tests"
runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"
- "8.0"
- "8.1"
- "8.2"

steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: "true"

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --prefer-dist

- name: Run Tests
run: cd tests && php run.php