Welcome to mirror list, hosted at ThFree Co, Russian Federation.

mutation-tests.yml « workflows « .github - github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d356bad2b44cd8712fc7b0ccd33903ef47cd3be3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Mutation tests

on:
  push:
    branches: [master]
  pull_request:
    branches: [master]

jobs:
  tests:
    name: Mutation tests with PHP ${{ matrix.php-version }}

    runs-on: ${{ matrix.operating-system }}
    if: "!contains(github.event.head_commit.message, '[ci skip]')"

    strategy:
      matrix:
        php-version: ["8.0"]
        operating-system: [ubuntu-latest]

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Fetch github.base_ref (for diffing)
        if: ${{ github.base_ref != '' }}
        run: |
          git fetch --depth=1 origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}

      - name: Install Gettext
        run: |
          sudo apt-get install -y gettext

      - name: Install PHP ${{ matrix.php-version }}
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php-version }}
          coverage: pcov
          ini-values: memory_limit=-1
          tools: composer:v2, phive

      - name: Install Infection
        # The GPG key can be found at https://infection.github.io/guide/installation.html
        run: |
          phive --no-progress install --target ./build/tools --trust-gpg-keys C5095986493B4AA0 infection

      - name: Get Composer cache directory
        id: composer-cache
        run: |
          echo "::set-output name=dir::$(composer config cache-files-dir)"

      - name: Cache dependencies
        uses: actions/cache@v2
        with:
          path: ${{ steps.composer-cache.outputs.dir }}
          key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}
          restore-keys: |
            composer-${{ runner.os }}-${{ matrix.php-version }}-

      - name: Install dependencies
        run: |
          composer update --no-interaction --no-progress
          ./scripts/generate-mo --quiet

      - name: Collect coverage report
        run: |
          composer run phpunit -- --exclude-group selenium --stop-on-failure

      - name: Infection
        if: ${{ github.base_ref != '' }}
        run: |
          CHANGED_FILES=$(git diff origin/$GITHUB_BASE_REF --diff-filter=AM --name-only | grep libraries/classes/ | paste -sd "," -);
          ./build/tools/infection -j$(nproc) --skip-initial-tests --no-interaction --no-progress --coverage=build/logs \
            --ignore-msi-with-no-mutations \
            --filter=$CHANGED_FILES
        env:
          INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}

      - name: Infection
        if: ${{ github.base_ref == '' }}
        run: |
          ./build/tools/infection -j$(nproc) --skip-initial-tests --no-interaction --no-progress --coverage=build/logs
        env:
          INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}