|
1 | 1 | name: CI
|
2 | 2 |
|
3 | 3 | on:
|
4 |
| - push: |
5 |
| - branches: |
6 |
| - tags: |
7 |
| - pull_request: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + tags: |
| 7 | + pull_request: |
8 | 8 |
|
9 | 9 | jobs:
|
10 |
| - build: |
11 |
| - runs-on: ${{ matrix.os }} |
12 |
| - name: PHP v${{ matrix.php }} with Mongo v${{ matrix.mongodb }} |
13 |
| - continue-on-error: ${{ matrix.experimental }} |
14 |
| - strategy: |
15 |
| - matrix: |
16 |
| - include: |
17 |
| - - { os: ubuntu-latest, php: 7.2, mongodb: 3.6, experimental: true} |
18 |
| - - { os: ubuntu-latest, php: 7.2, mongodb: '4.0', experimental: true} |
19 |
| - - { os: ubuntu-latest, php: 7.2, mongodb: 4.2, experimental: true} |
20 |
| - - { os: ubuntu-latest, php: 7.2, mongodb: 4.4, experimental: true} |
21 |
| - - { os: ubuntu-latest, php: 7.3, mongodb: 3.6, experimental: false} |
22 |
| - - { os: ubuntu-latest, php: 7.3, mongodb: '4.0', experimental: false} |
23 |
| - - { os: ubuntu-latest, php: 7.3, mongodb: 4.2, experimental: false} |
24 |
| - - { os: ubuntu-latest, php: 7.3, mongodb: 4.4, experimental: false} |
25 |
| - - { os: ubuntu-latest, php: 7.4, mongodb: 3.6, experimental: false} |
26 |
| - - { os: ubuntu-latest, php: 7.4, mongodb: '4.0', experimental: false} |
27 |
| - - { os: ubuntu-latest, php: 7.4, mongodb: 4.2, experimental: false} |
28 |
| - - { os: ubuntu-latest, php: 7.4, mongodb: 4.4, experimental: false} |
29 |
| - - { os: ubuntu-latest, php: 8.0, mongodb: 4.4, experimental: false} |
30 |
| - services: |
31 |
| - mongo: |
32 |
| - image: mongo:${{ matrix.mongodb }} |
33 |
| - ports: |
34 |
| - - 27017:27017 |
35 |
| - mysql: |
36 |
| - image: mysql:5.7 |
37 |
| - ports: |
38 |
| - - 3307:3306 |
39 |
| - env: |
40 |
| - MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' |
41 |
| - MYSQL_DATABASE: 'unittest' |
42 |
| - MYSQL_ROOT_PASSWORD: |
| 10 | + php-cs-fixer: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + php: |
| 15 | + - '7.4' |
| 16 | + steps: |
| 17 | + - name: Checkout |
| 18 | + uses: actions/checkout@v2 |
| 19 | + - name: Setup PHP |
| 20 | + uses: shivammathur/setup-php@v2 |
| 21 | + with: |
| 22 | + php-version: ${{ matrix.php }} |
| 23 | + extensions: curl,mbstring |
| 24 | + tools: php-cs-fixer |
| 25 | + coverage: none |
| 26 | + - name: Run PHP-CS-Fixer Fix |
| 27 | + run: php-cs-fixer fix --dry-run --diff --ansi |
43 | 28 |
|
44 |
| - steps: |
45 |
| - - uses: actions/checkout@v2 |
46 |
| - - name: "Installing php" |
47 |
| - uses: shivammathur/setup-php@v2 |
48 |
| - with: |
49 |
| - php-version: ${{ matrix.php }} |
50 |
| - extensions: curl,mbstring,xdebug |
51 |
| - coverage: xdebug |
52 |
| - tools: composer |
53 |
| - - name: Show PHP version |
54 |
| - run: php -v && composer -V |
55 |
| - - name: Show Docker version |
56 |
| - run: if [[ "$DEBUG" == "true" ]]; then docker version && env; fi |
57 |
| - env: |
58 |
| - DEBUG: ${{secrets.DEBUG}} |
59 |
| - - name: Download Composer cache dependencies from cache |
60 |
| - if: (!startsWith(matrix.php, '7.2')) |
61 |
| - id: composer-cache |
62 |
| - run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
63 |
| - - name: Cache Composer dependencies |
64 |
| - if: (!startsWith(matrix.php, '7.2')) |
65 |
| - uses: actions/cache@v1 |
66 |
| - with: |
67 |
| - path: ${{ steps.composer-cache.outputs.dir }} |
68 |
| - key: ${{ matrix.os }}-composer-${{ hashFiles('**/composer.json') }} |
69 |
| - restore-keys: ${{ matrix.os }}-composer- |
70 |
| - - name: Install dependencies |
71 |
| - if: (!startsWith(matrix.php, '7.2')) |
72 |
| - run: | |
73 |
| - composer install --no-interaction |
74 |
| - - name: Run tests |
75 |
| - if: (!startsWith(matrix.php, '7.2')) |
76 |
| - run: | |
77 |
| - ./vendor/bin/phpunit --coverage-clover coverage.xml |
78 |
| - env: |
79 |
| - MONGO_HOST: 0.0.0.0 |
80 |
| - MYSQL_HOST: 0.0.0.0 |
81 |
| - MYSQL_PORT: 3307 |
82 |
| - - uses: codecov/codecov-action@v1 |
83 |
| - with: |
84 |
| - token: ${{ secrets.CODECOV_TOKEN }} |
85 |
| - fail_ci_if_error: false |
| 29 | + build: |
| 30 | + runs-on: ${{ matrix.os }} |
| 31 | + name: PHP v${{ matrix.php }} with Mongo v${{ matrix.mongodb }} |
| 32 | + continue-on-error: ${{ matrix.experimental }} |
| 33 | + strategy: |
| 34 | + matrix: |
| 35 | + include: |
| 36 | + - { os: ubuntu-latest, php: 7.2, mongodb: 3.6, experimental: true } |
| 37 | + - { os: ubuntu-latest, php: 7.2, mongodb: '4.0', experimental: true } |
| 38 | + - { os: ubuntu-latest, php: 7.2, mongodb: 4.2, experimental: true } |
| 39 | + - { os: ubuntu-latest, php: 7.2, mongodb: 4.4, experimental: true } |
| 40 | + - { os: ubuntu-latest, php: 7.3, mongodb: 3.6, experimental: false } |
| 41 | + - { os: ubuntu-latest, php: 7.3, mongodb: '4.0', experimental: false } |
| 42 | + - { os: ubuntu-latest, php: 7.3, mongodb: 4.2, experimental: false } |
| 43 | + - { os: ubuntu-latest, php: 7.3, mongodb: 4.4, experimental: false } |
| 44 | + - { os: ubuntu-latest, php: 7.4, mongodb: 3.6, experimental: false } |
| 45 | + - { os: ubuntu-latest, php: 7.4, mongodb: '4.0', experimental: false } |
| 46 | + - { os: ubuntu-latest, php: 7.4, mongodb: 4.2, experimental: false } |
| 47 | + - { os: ubuntu-latest, php: 7.4, mongodb: 4.4, experimental: false } |
| 48 | + - { os: ubuntu-latest, php: 8.0, mongodb: 4.4, experimental: false } |
| 49 | + services: |
| 50 | + mongo: |
| 51 | + image: mongo:${{ matrix.mongodb }} |
| 52 | + ports: |
| 53 | + - 27017:27017 |
| 54 | + mysql: |
| 55 | + image: mysql:5.7 |
| 56 | + ports: |
| 57 | + - 3307:3306 |
| 58 | + env: |
| 59 | + MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' |
| 60 | + MYSQL_DATABASE: 'unittest' |
| 61 | + MYSQL_ROOT_PASSWORD: |
| 62 | + |
| 63 | + steps: |
| 64 | + - uses: actions/checkout@v2 |
| 65 | + - name: "Installing php" |
| 66 | + uses: shivammathur/setup-php@v2 |
| 67 | + with: |
| 68 | + php-version: ${{ matrix.php }} |
| 69 | + extensions: curl,mbstring,xdebug |
| 70 | + coverage: xdebug |
| 71 | + tools: composer |
| 72 | + - name: Show PHP version |
| 73 | + run: php -v && composer -V |
| 74 | + - name: Show Docker version |
| 75 | + run: if [[ "$DEBUG" == "true" ]]; then docker version && env; fi |
| 76 | + env: |
| 77 | + DEBUG: ${{secrets.DEBUG}} |
| 78 | + - name: Download Composer cache dependencies from cache |
| 79 | + if: (!startsWith(matrix.php, '7.2')) |
| 80 | + id: composer-cache |
| 81 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 82 | + - name: Cache Composer dependencies |
| 83 | + if: (!startsWith(matrix.php, '7.2')) |
| 84 | + uses: actions/cache@v1 |
| 85 | + with: |
| 86 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 87 | + key: ${{ matrix.os }}-composer-${{ hashFiles('**/composer.json') }} |
| 88 | + restore-keys: ${{ matrix.os }}-composer- |
| 89 | + - name: Install dependencies |
| 90 | + if: (!startsWith(matrix.php, '7.2')) |
| 91 | + run: | |
| 92 | + composer install --no-interaction |
| 93 | + - name: Run tests |
| 94 | + if: (!startsWith(matrix.php, '7.2')) |
| 95 | + run: | |
| 96 | + ./vendor/bin/phpunit --coverage-clover coverage.xml |
| 97 | + env: |
| 98 | + MONGO_HOST: 0.0.0.0 |
| 99 | + MYSQL_HOST: 0.0.0.0 |
| 100 | + MYSQL_PORT: 3307 |
| 101 | + - uses: codecov/codecov-action@v1 |
| 102 | + with: |
| 103 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 104 | + fail_ci_if_error: false |
0 commit comments