Skip to content

Commit

Permalink
Improve CI workflow (#1344)
Browse files Browse the repository at this point in the history
  • Loading branch information
IonBazan authored Dec 8, 2022
1 parent 6722b86 commit 51195ad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 35 deletions.
23 changes: 6 additions & 17 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
- pull_request

env:
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"
APP_ENV: test
DATABASE_URL: "mysql://root:[email protected]:3306/packagist?serverVersion=8.0"

jobs:
tests:
Expand All @@ -16,7 +16,7 @@ jobs:

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

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
Expand All @@ -27,24 +27,13 @@ jobs:
tools: composer
ini-values: apc.enable_cli=1

- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

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

- name: "Start MySQL"
run: |
sudo systemctl start mysql.service
echo 'DATABASE_URL="mysql://root:[email protected]:3306/packagist?serverVersion=8.0"' > .env.test.local
run: sudo systemctl start mysql.service

- name: "Install dependencies"
run: "composer install ${{ env.COMPOSER_FLAGS }}"
uses: "ramsey/composer-install@v2"
with:
composer-options: "--ansi --no-interaction --no-progress --prefer-dist"

- name: Start Redis
uses: supercharge/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

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

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
Expand Down
23 changes: 6 additions & 17 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
- pull_request

env:
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"
APP_ENV: dev
DATABASE_URL: "mysql://root:[email protected]:3306/packagist?serverVersion=8.0"

jobs:
tests:
Expand All @@ -16,7 +16,7 @@ jobs:

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

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
Expand All @@ -27,24 +27,13 @@ jobs:
tools: composer
ini-values: apc.enable_cli=1

- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

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

- name: "Start MySQL"
run: |
sudo systemctl start mysql.service
echo 'DATABASE_URL="mysql://root:[email protected]:3306/packagist?serverVersion=8.0"' > .env.dev.local
run: sudo systemctl start mysql.service

- name: "Install dependencies"
run: "composer install ${{ env.COMPOSER_FLAGS }}"
uses: "ramsey/composer-install@v2"
with:
composer-options: "--ansi --no-interaction --no-progress --prefer-dist"

- name: "Setup DB"
run: |
Expand Down

0 comments on commit 51195ad

Please sign in to comment.