|
1 | | -name: CI |
2 | | -on: |
3 | | - pull_request: |
4 | | - push: |
5 | | - branches: |
6 | | - - "master" |
7 | | - schedule: |
8 | | - - cron: "0 17 * * *" |
9 | | -jobs: |
10 | | - phpstan: |
11 | | - name: PHPStan |
12 | | - runs-on: ubuntu-20.04 |
13 | | - strategy: |
14 | | - matrix: |
15 | | - php-version: [7.4] |
16 | | - dependencies: ["", --prefer-lowest] |
17 | | - steps: |
18 | | - - uses: actions/checkout@v2 |
19 | | - - uses: shivammathur/setup-php@v2 |
20 | | - with: |
21 | | - coverage: none |
22 | | - php-version: ${{ matrix.php-version }} |
23 | | - tools: cs2pr |
24 | | - |
25 | | - - name: Cache dependencies installed with composer |
26 | | - uses: actions/cache@v1 |
27 | | - with: |
28 | | - path: ~/.composer/cache |
29 | | - key: php-${{ matrix.php-version }}-dependencies-${{ matrix.dependencies }} |
30 | | - restore-keys: php-${{ matrix.php-version }} |
31 | | - |
32 | | - - name: Install dependencies with composer |
33 | | - env: |
34 | | - COMPOSER_ARGS: "--prefer-stable ${{ matrix.dependencies }}" |
35 | | - run: make |
36 | | - |
37 | | - - name: Run a static analysis with phpstan/phpstan |
38 | | - env: |
39 | | - PHPSTAN_ARGS: --error-format=checkstyle |
40 | | - run: make -is static-analysis | cs2pr |
41 | | - |
42 | | - coding-standards: |
43 | | - name: Coding Standards |
44 | | - runs-on: ubuntu-20.04 |
45 | | - strategy: |
46 | | - matrix: |
47 | | - php-version: [7.4] |
48 | | - steps: |
49 | | - - uses: actions/checkout@v2 |
50 | | - - uses: shivammathur/setup-php@v2 |
51 | | - with: |
52 | | - coverage: none |
53 | | - php-version: ${{ matrix.php-version }} |
54 | | - tools: cs2pr |
55 | | - |
56 | | - - name: Cache dependencies installed with composer |
57 | | - uses: actions/cache@v1 |
58 | | - with: |
59 | | - path: ~/.composer/cache |
60 | | - key: php-${{ matrix.php-version }} |
61 | | - restore-keys: php-${{ matrix.php-version }} |
62 | | - |
63 | | - - name: Install dependencies with composer |
64 | | - env: |
65 | | - COMPOSER_ARGS: "--prefer-stable" |
66 | | - run: make |
67 | | - |
68 | | - - name: Run squizlabs/php_codesniffer |
69 | | - env: |
70 | | - PHPCS_ARGS: -q --no-colors --report=checkstyle |
71 | | - run: make -is cs | cs2pr |
72 | | - |
73 | | - tests: |
74 | | - name: Tests |
75 | | - runs-on: ubuntu-20.04 |
76 | | - strategy: |
77 | | - matrix: |
78 | | - php-version: [7.4, 8.0] |
79 | | - dependencies: ["", --prefer-lowest] |
| 1 | +name: "CI" |
80 | 2 |
|
81 | | - steps: |
82 | | - - uses: actions/checkout@v2 |
83 | | - - uses: shivammathur/setup-php@v2 |
84 | | - with: |
85 | | - coverage: none |
86 | | - php-version: ${{ matrix.php-version }} |
87 | | - |
88 | | - - name: Cache dependencies installed with composer |
89 | | - uses: actions/cache@v1 |
90 | | - with: |
91 | | - path: ~/.composer/cache |
92 | | - key: php-${{ matrix.php-version }}-dependencies-${{ matrix.dependencies }} |
93 | | - restore-keys: php-${{ matrix.php-version }} |
94 | | - |
95 | | - - name: Install dependencies with composer |
96 | | - env: |
97 | | - COMPOSER_ARGS: "--prefer-stable ${{ matrix.dependencies }}" |
98 | | - run: make |
99 | | - |
100 | | - - name: Run tests |
101 | | - run: make test |
102 | | - |
103 | | - coverage: |
104 | | - name: Tests Coverage |
105 | | - runs-on: ubuntu-20.04 |
106 | | - strategy: |
107 | | - matrix: |
108 | | - php-version: [7.4] |
109 | | - |
110 | | - steps: |
111 | | - - uses: actions/checkout@v2 |
112 | | - - uses: shivammathur/setup-php@v2 |
113 | | - with: |
114 | | - coverage: pcov |
115 | | - php-version: ${{ matrix.php-version }} |
116 | | - |
117 | | - - name: Cache dependencies installed with composer |
118 | | - uses: actions/cache@v1 |
119 | | - with: |
120 | | - path: ~/.composer/cache |
121 | | - key: php-${{ matrix.php-version }} |
122 | | - restore-keys: php-${{ matrix.php-version }} |
123 | | - |
124 | | - - name: Install dependencies with composer |
125 | | - env: |
126 | | - COMPOSER_ARGS: "--prefer-stable" |
127 | | - run: make |
128 | | - |
129 | | - - name: Run tests coverage |
130 | | - env: |
131 | | - PHPUNIT_ARGS: "--coverage-clover coverage/clover.xml" |
132 | | - run: make test |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | +# branches: |
| 7 | +# - "master" |
| 8 | + schedule: |
| 9 | + - cron: "42 3 * * *" |
133 | 10 |
|
134 | | - - name: Report to Coveralls |
135 | | - env: |
136 | | - COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
137 | | - COVERALLS_RUN_LOCALLY: 1 |
138 | | - run: vendor/bin/php-coveralls --coverage_clover coverage/clover.xml --json_path coverage/coveralls.json |
| 11 | +jobs: |
| 12 | + phpunit: |
| 13 | + name: "PHPUnit" |
| 14 | + runs-on: "ubuntu-20.04" |
| 15 | + |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + php-version: |
| 19 | + - "7.4" |
| 20 | + - "8.0" |
| 21 | + dependencies: |
| 22 | + - "highest" |
| 23 | + include: |
| 24 | + - dependencies: "lowest" |
| 25 | + php-version: "7.4" |
| 26 | + |
| 27 | + steps: |
| 28 | + - name: "Checkout" |
| 29 | + uses: "actions/checkout@v2" |
| 30 | + with: |
| 31 | + fetch-depth: 2 |
| 32 | + |
| 33 | + - name: "Install PHP" |
| 34 | + uses: "shivammathur/setup-php@v2" |
| 35 | + with: |
| 36 | + php-version: "${{ matrix.php-version }}" |
| 37 | + coverage: "pcov" |
| 38 | + ini-values: "zend.assertions=1" |
| 39 | + |
| 40 | + - name: "Install dependencies with Composer" |
| 41 | + uses: "ramsey/composer-install@v1" |
| 42 | + with: |
| 43 | + dependency-versions: "${{ matrix.dependencies }}" |
| 44 | + |
| 45 | + - name: "Run PHPUnit" |
| 46 | + run: "vendor/bin/phpunit --coverage-clover=coverage.xml" |
| 47 | + |
| 48 | + - name: "Upload coverage file" |
| 49 | + uses: "actions/upload-artifact@v2" |
| 50 | + with: |
| 51 | + name: "phpunit-${{ matrix.deps }}-${{ matrix.php-version }}.coverage" |
| 52 | + path: "coverage.xml" |
| 53 | + |
| 54 | + upload_coverage: |
| 55 | + name: "Upload coverage to Codecov" |
| 56 | + runs-on: "ubuntu-20.04" |
| 57 | + needs: |
| 58 | + - "phpunit" |
| 59 | + |
| 60 | + steps: |
| 61 | + - name: "Checkout" |
| 62 | + uses: "actions/checkout@v2" |
| 63 | + with: |
| 64 | + fetch-depth: 2 |
| 65 | + |
| 66 | + - name: "Download coverage files" |
| 67 | + uses: "actions/download-artifact@v2" |
| 68 | + with: |
| 69 | + path: "reports" |
| 70 | + |
| 71 | + - name: "Upload to Codecov" |
| 72 | + uses: "codecov/codecov-action@v1" |
| 73 | + with: |
| 74 | + directory: reports |
0 commit comments