|
6 | 6 | - cron: "0 0 * * 0"
|
7 | 7 |
|
8 | 8 | jobs:
|
9 |
| - composer-validation: |
10 |
| - name: Composer Validation |
11 |
| - runs-on: ubuntu-latest |
12 |
| - steps: |
13 |
| - - name: checkout |
14 |
| - uses: actions/checkout@v2 |
15 |
| - |
16 |
| - - name: Setup PHP |
17 |
| - uses: shivammathur/setup-php@v2 |
18 |
| - with: |
19 |
| - php-version: "8.0" |
20 |
| - extensions: json, pdo_mysql, zip |
21 |
| - coverage: none |
22 |
| - |
23 |
| - - name: Run composer validate |
24 |
| - run: composer validate --strict |
25 |
| - |
26 |
| - unit-tests: |
27 |
| - name: Unit Tests |
28 |
| - strategy: |
29 |
| - fail-fast: false |
30 |
| - matrix: |
31 |
| - php-version: |
32 |
| - - "8.0" |
33 |
| - runs-on: ubuntu-latest |
34 |
| - steps: |
35 |
| - - name: Checkout |
36 |
| - uses: actions/checkout@v2 |
37 |
| - |
38 |
| - - name: Setup PHP |
39 |
| - uses: shivammathur/setup-php@v2 |
40 |
| - with: |
41 |
| - php-version: ${{ matrix.php-version }} |
42 |
| - extensions: json, pdo_mysql, zip |
43 |
| - coverage: xdebug |
44 |
| - |
45 |
| - - name: Get composer cache directory |
46 |
| - id: composer-cache |
47 |
| - run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
48 |
| - |
49 |
| - - name: Cache composer dependencies |
50 |
| - uses: actions/cache@v2 |
51 |
| - with: |
52 |
| - path: ${{ steps.composer-cache.outputs.dir }} |
53 |
| - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
54 |
| - restore-keys: ${{ runner.os }}-composer- |
55 |
| - |
56 |
| - - name: Setup problem matchers |
57 |
| - run: | |
58 |
| - echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" |
59 |
| - echo "::add-matcher::.github/problem-matchers/coverage-check.json" |
60 |
| -
|
61 |
| - - name: Install dependencies |
62 |
| - run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader |
63 |
| - |
64 |
| - - name: Run phpunit |
65 |
| - run: vendor/bin/phpunit --testsuite unit-test --coverage-clover=coverage.xml |
66 |
| - |
67 |
| - - name: Check coverage.xml existence |
68 |
| - id: check-coverage-file |
69 |
| - uses: andstor/file-existence-action@v1 |
70 |
| - with: |
71 |
| - files: coverage.xml |
72 |
| - |
73 |
| - - name: Run coverage-check |
74 |
| - if: ${{ always() && steps.check-coverage-file.outputs.files_exists == 'true' }} |
75 |
| - run: vendor/bin/coverage-check coverage.xml 100 |
76 |
| - |
77 |
| - - name: Upload coverage as artifacts |
78 |
| - if: ${{ always() && steps.check-coverage-file.outputs.files_exists == 'true' }} |
79 |
| - uses: actions/upload-artifact@v2 |
80 |
| - with: |
81 |
| - name: coverage-${{ matrix.php-version }} |
82 |
| - path: coverage.xml |
83 |
| - |
84 |
| - - name: Upload coverage to Codecov |
85 |
| - if: ${{ always() && steps.check-coverage-file.outputs.files_exists == 'true' }} |
86 |
| - uses: codecov/codecov-action@v1 |
87 |
| - with: |
88 |
| - name: coverage-${{ matrix.php-version }} |
89 |
| - file: coverage.xml |
90 |
| - |
91 |
| - coding-guidelines: |
92 |
| - name: Coding Guidelines |
93 |
| - runs-on: ubuntu-latest |
94 |
| - steps: |
95 |
| - - name: checkout |
96 |
| - uses: actions/checkout@v2 |
97 |
| - |
98 |
| - - name: Setup PHP |
99 |
| - uses: shivammathur/setup-php@v2 |
100 |
| - with: |
101 |
| - php-version: "8.0" |
102 |
| - extensions: json, pdo_mysql, zip |
103 |
| - tools: cs2pr |
104 |
| - coverage: none |
105 |
| - |
106 |
| - - name: Get composer cache directory |
107 |
| - id: composer-cache |
108 |
| - run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
109 |
| - |
110 |
| - - name: Cache composer dependencies |
111 |
| - uses: actions/cache@v2 |
112 |
| - with: |
113 |
| - path: ${{ steps.composer-cache.outputs.dir }} |
114 |
| - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
115 |
| - restore-keys: ${{ runner.os }}-composer- |
116 |
| - |
117 |
| - - name: Install dependencies |
118 |
| - run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader |
119 |
| - |
120 |
| - - name: Run phpcs |
121 |
| - run: vendor/bin/phpcs -q --report=checkstyle | cs2pr |
122 |
| - |
123 |
| - type-checker: |
124 |
| - name: Type Checker |
125 |
| - runs-on: ubuntu-latest |
126 |
| - steps: |
127 |
| - - name: Checkout |
128 |
| - uses: actions/checkout@v2 |
129 |
| - |
130 |
| - - name: Setup PHP |
131 |
| - uses: shivammathur/setup-php@v2 |
132 |
| - with: |
133 |
| - php-version: "8.0" |
134 |
| - extensions: json, pdo_mysql, zip |
135 |
| - coverage: none |
136 |
| - |
137 |
| - - name: Get composer cache directory |
138 |
| - id: composer-cache |
139 |
| - run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
140 |
| - |
141 |
| - - name: Cache composer dependencies |
142 |
| - uses: actions/cache@v2 |
143 |
| - with: |
144 |
| - path: ${{ steps.composer-cache.outputs.dir }} |
145 |
| - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
146 |
| - restore-keys: ${{ runner.os }}-composer- |
147 |
| - |
148 |
| - - name: Install dependencies |
149 |
| - run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader |
150 |
| - |
151 |
| - - name: Run phpstan |
152 |
| - run: vendor/bin/phpstan analyse --no-interaction |
| 9 | + call-workflow-ci-php-general: |
| 10 | + name: General |
| 11 | + uses: factorio-item-browser/github-workflows/.github/workflows/ci-php-general.yaml@v1 |
| 12 | + with: |
| 13 | + extensions: json, pdo_mysql, zip |
| 14 | + |
| 15 | + call-workflow-ci-php-tests: |
| 16 | + name: Tests |
| 17 | + uses: factorio-item-browser/github-workflows/.github/workflows/ci-php-tests.yaml@v1 |
| 18 | + with: |
| 19 | + extensions: json, pdo_mysql, zip |
| 20 | + php-versions: "8.0" # Package "laminas/laminas-log" does not support PHP 8.1 yet. |
0 commit comments