-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from ngmy/feature/php8-support
Support PHP 8.0
- Loading branch information
Showing
39 changed files
with
3,766 additions
and
1,704 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
service_name: travis-ci | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
if [[ -f .envrc.local ]]; then | ||
source_env .envrc.local | ||
fi | ||
|
||
# vim: set ft=bash: |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export PATH=$PWD/laradockctl/bin:$PATH | ||
export LARADOCKCTL_COMMAND_PATH=$PWD/.laradock/commands:$PWD/laradockctl/src/commands |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# These are supported funding model platforms | ||
|
||
github: ngmy | ||
patreon: # Replace with a single Patreon username | ||
open_collective: # Replace with a single Open Collective username | ||
ko_fi: # Replace with a single Ko-fi username | ||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel | ||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry | ||
liberapay: # Replace with a single Liberapay username | ||
issuehunt: # Replace with a single IssueHunt username | ||
otechie: # Replace with a single Otechie username | ||
custom: https://flattr.com/@ngmy |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
name: PHP CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
install_tools: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
name: Install tools | ||
|
||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install PHIVE | ||
uses: nick-invision/retry@v2 | ||
with: | ||
timeout_minutes: 10 | ||
max_attempts: 3 | ||
command: | | ||
wget -O phive.phar https://phar.io/releases/phive.phar | ||
wget -O phive.phar.asc https://phar.io/releases/phive.phar.asc | ||
gpg --keyserver pool.sks-keyservers.net --recv-keys 0x9D8A98B29B2D5D79 | ||
gpg --verify phive.phar.asc phive.phar | ||
- name: Install tools | ||
uses: nick-invision/retry@v2 | ||
with: | ||
timeout_minutes: 10 | ||
max_attempts: 3 | ||
command: | | ||
php phive.phar --no-progress install \ | ||
--copy \ | ||
--trust-gpg-keys E82B2FB314E9906E,31C7E470E2138192,CF1A108D0E7AE720,4AA394086372C20A | ||
- name: Upload tools to artifact store | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: tools | ||
path: tools | ||
|
||
test: | ||
|
||
needs: install_tools | ||
|
||
runs-on: ubuntu-latest | ||
|
||
services: | ||
mysql: | ||
image: mysql | ||
ports: | ||
- 3306:3306 | ||
options: >- | ||
--health-cmd "mysqladmin ping -h 127.0.0.1" | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
env: | ||
MYSQL_ALLOW_EMPTY_PASSWORD: yes | ||
MYSQL_DATABASE: test | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: ['7.3', '7.4', '8.0'] | ||
laravel: ['6', '7', '8'] | ||
deps: [highest, lowest] | ||
include: | ||
- php: '7.4' | ||
laravel: '8' | ||
deps: current | ||
|
||
name: Test (PHP ${{ matrix.php }}, Laravel ${{ matrix.laravel }}, ${{ matrix.deps }} dependencies) | ||
|
||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up PHP ${{ matrix.php }} | ||
run: sudo update-alternatives --set php /usr/bin/php${{ matrix.php }} | ||
|
||
- name: Update Composer to latest version | ||
run: composer self-update | ||
|
||
- name: Specify composer.json to use | ||
run: | | ||
if [[ "${{ matrix.laravel }}" == '6' ]]; then | ||
export COMPOSER=composer-ci-laravel6.json | ||
fi | ||
if [[ "${{ matrix.laravel }}" == '7' ]]; then | ||
export COMPOSER=composer-ci-laravel7.json | ||
fi | ||
if [[ "${{ matrix.laravel }}" == '8' ]]; then | ||
export COMPOSER=composer-ci-laravel8.json | ||
fi | ||
- name: Validate composer.json and composer.lock | ||
run: composer validate | ||
|
||
- name: Cache Composer packages | ||
if: matrix.deps == 'current' | ||
id: composer-cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-php- | ||
- name: Install dependencies | ||
run: | | ||
if [[ "${{ matrix.deps }}" == 'current' && "${{ steps.composer-cache.outputs.cache-hit }}" != 'true' ]]; then | ||
composer install --no-interaction | ||
fi | ||
if [[ "${{ matrix.deps }}" == 'highest' ]]; then | ||
composer update --no-interaction | ||
fi | ||
if [[ "${{ matrix.deps }}" == 'lowest' ]]; then | ||
composer update --no-interaction --prefer-lowest --prefer-stable | ||
fi | ||
- name: Download tools from artifact store | ||
uses: actions/download-artifact@master | ||
with: | ||
name: tools | ||
path: tools | ||
|
||
- name: Change MySQL authentication method | ||
run: mysql -h 127.0.0.1 -u root -e "ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY ''" | ||
|
||
- name: Run lint | ||
run: composer lint | ||
|
||
- name: Run bug analysis | ||
run: composer findbugs | ||
|
||
- name: Run unit tests | ||
env: | ||
DB_HOST: '127.0.0.1' | ||
DB_DATABASE: 'test' | ||
DB_USERNAME: 'root' | ||
DB_PASSWORD: '' | ||
XDEBUG_MODE: coverage | ||
run: composer test | ||
|
||
- name: Upload coverage results to Coveralls | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
uses: nick-invision/retry@v2 | ||
with: | ||
timeout_minutes: 10 | ||
max_attempts: 3 | ||
command: php tools/php-coveralls --coverage_clover=build/logs/clover.xml -v |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
/.laradock/data/* | ||
!/.laradock/data/.gitkeep | ||
/build/ | ||
/tools/ | ||
/vendor/ | ||
.envrc.local | ||
.php_cs | ||
.php_cs.cache | ||
.phpunit.result.cache | ||
/build/ | ||
/vendor/ | ||
phpcs.xml | ||
phpstan.neon | ||
phpunit.xml |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[submodule "laradock"] | ||
path = laradock | ||
url = https://github.com/Laradock/laradock.git | ||
[submodule "laradockctl"] | ||
path = laradockctl | ||
url = https://github.com/ngmy/laradockctl.git |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
set -Ceuo pipefail | ||
|
||
local NAME='my:destroy' | ||
local DESCRIPTION='Destory my development environment' | ||
|
||
handle() { | ||
docker-compose down -v | ||
local YN | ||
read -p 'Do you want to remove data? (y/N)' YN | ||
if [[ "${YN}" == 'y' ]]; then | ||
sudo rm -rf ../.laradock/data/* | ||
fi | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
set -Ceuo pipefail | ||
|
||
local NAME='my:down' | ||
local DESCRIPTION='Shut down my development environment' | ||
|
||
handle() { | ||
docker-compose stop | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
set -Ceuo pipefail | ||
|
||
local NAME='my:phive' | ||
local DESCRIPTION='Execute a PHIVE command' | ||
|
||
handle() { | ||
docker-compose exec -u laradock workspace phive --home .laradock/data/phive "$@" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
set -Ceuo pipefail | ||
|
||
local NAME='my:up' | ||
local DESCRIPTION='Start up my development environment' | ||
|
||
handle() { | ||
cp -f ../.laradock/env-development .env | ||
docker-compose up -d --build mysql workspace | ||
docker-compose exec -u laradock workspace composer install | ||
cp ../phpunit.xml.dist ../phpunit.xml | ||
sed -i 's/name="DB_HOST" value=""/name="DB_HOST" value="mysql"/g' ../phpunit.xml | ||
sed -i 's/name="DB_DATABASE" value=""/name="DB_DATABASE" value="test"/g' ../phpunit.xml | ||
sed -i 's/name="DB_USERNAME" value=""/name="DB_USERNAME" value="root"/g' ../phpunit.xml | ||
sed -i 's/name="DB_PASSWORD" value=""/name="DB_PASSWORD" value="root"/g' ../phpunit.xml | ||
if ! docker-compose exec workspace bash -c 'test -f /usr/local/bin/phive'; then | ||
docker-compose exec workspace curl -fsSL https://phar.io/releases/phive.phar -o /tmp/phive.phar | ||
docker-compose exec workspace curl -fsSL https://phar.io/releases/phive.phar.asc -o /tmp/phive.phar.asc | ||
docker-compose exec workspace gpg --keyserver ipv4.pool.sks-keyservers.net --recv-keys 0x9D8A98B29B2D5D79 | ||
docker-compose exec workspace gpg --verify /tmp/phive.phar.asc /tmp/phive.phar | ||
docker-compose exec workspace chmod +x /tmp/phive.phar | ||
docker-compose exec workspace mv /tmp/phive.phar /usr/local/bin/phive | ||
fi | ||
docker-compose exec -u laradock workspace phive --home .laradock/data/phive install | ||
} |
Empty file.
Oops, something went wrong.