|
19 | 19 | - '.github/workflows/infection.yml' |
20 | 20 |
|
21 | 21 | jobs: |
22 | | - main: |
23 | | - name: Mutation Testing |
24 | | - runs-on: ubuntu-latest |
25 | | - if: "!contains(github.event.head_commit.message, '[ci skip]')" |
26 | | - |
27 | | - steps: |
28 | | - - name: Checkout |
29 | | - uses: actions/checkout@v4 |
30 | | - |
31 | | - - name: Set up PHP |
32 | | - uses: shivammathur/setup-php@v2 |
33 | | - with: |
34 | | - php-version: '8.1' |
35 | | - tools: infection, phpunit |
36 | | - extensions: intl, json, mbstring, gd, xml, sqlite3 |
37 | | - coverage: xdebug |
38 | | - env: |
39 | | - COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
40 | | - |
41 | | - - name: Set up problem matchers for PHPUnit |
42 | | - run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" |
43 | | - |
44 | | - - name: Configure matchers |
45 | | - uses: mheap/phpunit-matcher-action@v1 |
46 | | - |
47 | | - - name: Get composer cache directory |
48 | | - run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV |
49 | | - |
50 | | - - name: Cache composer dependencies |
51 | | - uses: actions/cache@v3 |
52 | | - with: |
53 | | - path: ${{ env.COMPOSER_CACHE_FILES_DIR }} |
54 | | - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} |
55 | | - restore-keys: ${{ runner.os }}-composer- |
56 | | - |
57 | | - - name: Install dependencies |
58 | | - run: | |
59 | | - if [ -f composer.lock ]; then |
60 | | - composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader |
61 | | - else |
62 | | - composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader |
63 | | - fi |
64 | | -
|
65 | | - - name: Test with PHPUnit |
66 | | - run: vendor/bin/phpunit --teamcity |
67 | | - env: |
68 | | - GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
69 | | - |
70 | | - - name: Mutate with Infection |
71 | | - run: | |
72 | | - git fetch --depth=1 origin $GITHUB_BASE_REF |
73 | | - infection --threads=2 --skip-initial-tests --coverage=build/phpunit --git-diff-base=origin/$GITHUB_BASE_REF --git-diff-filter=AM --logger-github --ignore-msi-with-no-mutations |
| 22 | + infection: |
| 23 | + uses: codeigniter4/.github/.github/workflows/infection.yml@main |
0 commit comments