-
Notifications
You must be signed in to change notification settings - Fork 122
Fixups from Migrator pull request, and CI to GitHub Actions #494
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5921fb2
Add missing copyrights.
markstory 35abfa6
Incorporate feedback from pull request.
markstory 8d17574
Fix up failing tests.
markstory e38a5d4
First pass at migrating CI configuration to GitHub Actions.
markstory 6aa56f7
Remove postgres temporarily and change paths up to fix temp dir.
markstory c6b3e7b
Fix phpcs errors.
markstory 35fb4a1
Move important configuration to the right file.
markstory ed85c1e
Fix coding standards errors.
markstory 13799f8
Exclude more generated code
markstory 1d74e61
More tweaks to CI configuration.
markstory 17382c1
Remove sources of variance in tests.
markstory 88717c9
Fix more phpcs errors
markstory File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,131 @@ | ||
| name: CI | ||
|
|
||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| pull_request: | ||
| branches: | ||
| - '*' | ||
|
|
||
| jobs: | ||
| testsuite-linux: | ||
| runs-on: ubuntu-18.04 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| php-version: ['7.2', '7.4'] | ||
| #db-type: [mysql, pgsql, sqlite] | ||
| db-type: [mysql, sqlite] | ||
| prefer-lowest: [''] | ||
| include: | ||
| - php-version: '7.2' | ||
| db-type: 'sqlite' | ||
| prefer-lowest: 'prefer-lowest' | ||
|
|
||
| services: | ||
| postgres: | ||
| image: postgres | ||
| ports: | ||
| - 5432:5432 | ||
| env: | ||
| POSTGRES_PASSWORD: postgres | ||
|
|
||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
|
|
||
| - name: Setup MySQL | ||
| if: matrix.db-type == 'mysql' | ||
| run: | | ||
| sudo service mysql start | ||
| mysql -h 127.0.0.1 -u root -proot -e 'CREATE DATABASE cakephp_test DEFAULT COLLATE=utf8mb4_general_ci;' | ||
| mysql -h 127.0.0.1 -u root -proot -e 'CREATE DATABASE cakephp_comparisons;' | ||
|
|
||
| - name: Setup Postgres | ||
| if: matrix.db-type == 'pgsql' | ||
| run: | | ||
| psql -c 'CREATE DATABASE cakephp_test;' -U postgres | ||
| psql -c 'CREATE DATABASE cakephp_comparisons;' -U postgres | ||
|
|
||
| - name: Setup PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: ${{ matrix.php-version }} | ||
| extensions: mbstring, intl, pdo_${{ matrix.db-type }} | ||
| coverage: pcov | ||
|
|
||
| - name: Get composer cache directory | ||
| id: composer-cache | ||
| run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
|
||
| - name: Get date part for cache key | ||
| id: key-date | ||
| run: echo "::set-output name=date::$(date +'%Y-%m')" | ||
|
|
||
| - name: Cache composer dependencies | ||
| uses: actions/cache@v1 | ||
| with: | ||
| path: ${{ steps.composer-cache.outputs.dir }} | ||
| key: ${{ runner.os }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}-${{ matrix.prefer-lowest }} | ||
|
|
||
| - name: Composer install | ||
| run: | | ||
| if [[ ${{ matrix.php-version }} == '8.0' ]]; then | ||
| composer install --ignore-platform-reqs | ||
| elif ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then | ||
| composer update --prefer-lowest --prefer-stable | ||
| else | ||
| composer install | ||
| fi | ||
|
|
||
| - name: Run PHPUnit | ||
| run: | | ||
| if [[ ${{ matrix.db-type }} == 'sqlite' ]]; then | ||
| export DB='sqlite' | ||
| fi | ||
| if [[ ${{ matrix.db-type }} == 'mysql' ]]; then | ||
| export DB_URL='mysql://root:root@127.0.0.1/cakephp_test' | ||
| export DB_URL_COMPARE='mysql://root:root@127.0.0.1/cakephp_comparisons' | ||
| fi | ||
| if [[ ${{ matrix.db-type }} == 'pgsql' ]]; then | ||
| export DB_URL='postgres://postgres:postgres@127.0.0.1/cakephp_test' | ||
| export DB_URL_COMPARE='postgres://postgres:postgres@127.0.0.1/cakephp_comparisons' | ||
| fi | ||
| if [[ ${{ matrix.php-version }} == '7.4' && ${{ matrix.db-type }} == 'mysql' ]]; then | ||
| vendor/bin/phpunit --coverage-clover=coverage.xml | ||
| else | ||
| vendor/bin/phpunit | ||
| fi | ||
|
|
||
| - name: Code Coverage Report | ||
| if: success() && matrix.php-version == '7.4' && matrix.db-type == 'mysql' | ||
| uses: codecov/codecov-action@v1 | ||
|
|
||
| cs-stan: | ||
| name: Coding Standard & Static Analysis | ||
| runs-on: ubuntu-18.04 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
|
|
||
| - name: Setup PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: '7.4' | ||
| extensions: mbstring, intl | ||
| coverage: none | ||
| tools: psalm:^3.11, phpstan:^0.12, cs2pr | ||
|
|
||
| - name: Composer Install | ||
| run: composer install | ||
|
|
||
| - name: Run phpcs | ||
| run: vendor/bin/phpcs --report=checkstyle src/ tests/ | cs2pr | ||
|
|
||
| - name: Run psalm | ||
| run: psalm --output-format=github | ||
|
|
||
| - name: Run phpstan | ||
| run: phpstan analyse src/ | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if we've done the work to get migrations working on 8.0. I can add that to the matrix once tests are passing again.