From 6eccfb1b0d8f5a68857363ac803a8ec24ba1430f Mon Sep 17 00:00:00 2001 From: Lastorder <18280396+Lastorder-DC@users.noreply.github.com> Date: Wed, 2 Dec 2020 14:58:36 +0900 Subject: [PATCH 1/2] Migrate travis to github actions --- .github/workflows/php.yml | 43 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/php.yml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 000000000..8221fa7c9 --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,43 @@ +name: PHP Lint & Run codeception +on: + push: + branches: [ master, develop ] + pull_request: + branches: [ develop ] + +jobs: + build: + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + operating-system: [ ubuntu-16.04 ] + php: [ '7.0', '7.1', '7.2', '7.3', '7.4' ] + name: PHP ${{ matrix.php }} + steps: + - uses: actions/checkout@v2 + - name: Setup PHP + uses: nanasess/setup-php@master + if: matrix.php != '7.4' + with: + php-version: ${{ matrix.php }} + + - name: Start MySQL + run: sudo systemctl start mysql.service + + - name: Create database + run: mysql -uroot -proot -e "CREATE DATABASE rhymix CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci" + + - name: Create user and set privileges + run: mysql -uroot -proot -e "create user 'travis'@'localhost' identified by 'travis'; FLUSH PRIVILEGES" && mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON rhymix.* TO travis@localhost" + + - name: Download codeception + run: wget https://codeception.com/releases/2.3.9/codecept.phar + + - name: Run PHP development server + run: php -S localhost:8000 & + + - name: PHP Lint + run: if find . -name "*.php" ! -path "./vendor/*" -print0 | xargs -0 -n 1 -P 8 php -l | grep -v "No syntax errors detected"; then exit 1; fi + + - name: Build and run codeception + run: php codecept.phar build && php codecept.phar run --debug --fail-fast --env travis From 8ebb2b22a9c786bbd098b940c6eea2228325d3de Mon Sep 17 00:00:00 2001 From: Lastorder-DC <18280396+Lastorder-DC@users.noreply.github.com> Date: Mon, 14 Dec 2020 11:09:56 +0900 Subject: [PATCH 2/2] Only run phplint at php 8.0 Do not run codeception at php 8.0(currently not works) --- .github/workflows/{php.yml => ci.yml} | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) rename .github/workflows/{php.yml => ci.yml} (85%) diff --git a/.github/workflows/php.yml b/.github/workflows/ci.yml similarity index 85% rename from .github/workflows/php.yml rename to .github/workflows/ci.yml index 8221fa7c9..5e484e388 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,8 @@ jobs: strategy: matrix: operating-system: [ ubuntu-16.04 ] - php: [ '7.0', '7.1', '7.2', '7.3', '7.4' ] + php: [ '7.0', '7.1', '7.2', '7.3', '7.4', '8.0' ] + name: PHP ${{ matrix.php }} steps: - uses: actions/checkout@v2 @@ -22,22 +23,28 @@ jobs: php-version: ${{ matrix.php }} - name: Start MySQL + if: matrix.php != '8.0' run: sudo systemctl start mysql.service - name: Create database + if: matrix.php != '8.0' run: mysql -uroot -proot -e "CREATE DATABASE rhymix CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci" - name: Create user and set privileges + if: matrix.php != '8.0' run: mysql -uroot -proot -e "create user 'travis'@'localhost' identified by 'travis'; FLUSH PRIVILEGES" && mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON rhymix.* TO travis@localhost" - name: Download codeception + if: matrix.php != '8.0' run: wget https://codeception.com/releases/2.3.9/codecept.phar - name: Run PHP development server + if: matrix.php != '8.0' run: php -S localhost:8000 & - name: PHP Lint run: if find . -name "*.php" ! -path "./vendor/*" -print0 | xargs -0 -n 1 -P 8 php -l | grep -v "No syntax errors detected"; then exit 1; fi - name: Build and run codeception + if: matrix.php != '8.0' run: php codecept.phar build && php codecept.phar run --debug --fail-fast --env travis