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

tests.yml « workflows « .github - github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 29c26de139bc1a55fd89c9d5bf35cac154d37289 (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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
name: Run tests

on:
  push:
  pull_request:
    types: [opened, synchronize, reopened]
    branches:
      - master
      - QA_**

jobs:
    multi-arch-tests-php:
        name: Test on php ${{ matrix.php-version }} (${{ matrix.arch }})
        runs-on: ubuntu-latest
        continue-on-error: ${{ matrix.experimental }}
        strategy:
          fail-fast: false
          matrix:
            include:
              - { php-version: '7', experimental: false, arch: 'amd64', exclude-phpunit-groups: 'selenium,extension-iconv' }
              - { php-version: '7', experimental: false, arch: 'arm64v8', exclude-phpunit-groups: 'selenium,extension-iconv' }
              - { php-version: '7', experimental: false, arch: 'arm32v7', exclude-phpunit-groups: 'selenium,extension-iconv,32bit-incompatible' }
              - { php-version: '7', experimental: false, arch: 'arm32v6', exclude-phpunit-groups: 'selenium,extension-iconv,32bit-incompatible' }
              - { php-version: '7', experimental: false, arch: 'i386', exclude-phpunit-groups: 'selenium,extension-iconv,32bit-incompatible' }
              - { php-version: '7', experimental: true, arch: 'ppc64le', exclude-phpunit-groups: 'selenium,extension-iconv' }
              - { php-version: '7', experimental: false, arch: 's390x', exclude-phpunit-groups: 'selenium,extension-iconv,32bit-incompatible' }
        steps:
            - uses: actions/checkout@v3
            - name: Write script
              # tcpdf allowed memory exhausted needs the memory_limit workaround
              # musl-locales and musl-locales-lang are needed to run some locale specific tests
              # gettext is needed to run generate-mo
              # pcov for code coverage
              # ctype for psalm
              run: |
                  printf "set -exu && \
                  export V='%s' && \
                  apk add --update --no-cache \
                  php\$V-cli php\$V-mysqli php\$V-session php\$V-mbstring php\$V-ctype \
                  php\$V-iconv php\$V-xml php\$V-tokenizer php\$V-xmlwriter php\$V-simplexml \
                  php\$V-dom php\$V-json php\$V-bz2 php\$V-curl php\$V-gd php\$V-zip \
                  musl-locales musl-locales-lang \
                  gettext composer && \
                  apk add --update --no-cache --repository https://dl-cdn.alpinelinux.org/alpine/edge/testing php\$V-pecl-pcov && \
                  composer update && \
                  ./scripts/generate-mo && \
                  php -d memory_limit=512M ./vendor/bin/phpunit --exclude-group=%s" \
                  "${{ matrix.php-version }}" "${{ matrix.exclude-phpunit-groups }}" > ./do-tests.sh
            - name: Setup multi arch support
              run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
            - name: Print arch
              run: docker run --rm ${{ matrix.arch }}/alpine:3.14 uname -a
            - name: Run tests on php ${{ matrix.php-version }}
              run: docker run -v $PWD:/app --workdir /app --rm ${{ matrix.arch }}/alpine:3.14 sh /app/do-tests.sh
            - name: Send coverage
              uses: codecov/codecov-action@v1
              with:
                flags: arch-${{ matrix.php-version }}-${{ matrix.arch }}
                name: phpunit-${{ matrix.php-version }}-${{ matrix.arch }}
    test-php:
        name: Test on php ${{ matrix.php-version }} and ${{ matrix.os }}
        runs-on: ${{ matrix.os }}
        continue-on-error: ${{ matrix.experimental }}
        strategy:
            matrix:
                php-version: ["7.1", "7.2", "7.3", "7.4", "8.0", "8.1"]
                experimental: [false]
                os: [ubuntu-latest]
                include:
                    - { php-version: 'nightly', composer-options: '--ignore-platform-req=php+', experimental: true, os: ubuntu-latest }
        steps:
            - uses: actions/checkout@v3
              with:
                  # Fetch some commits for Scrutinizer coverage upload
                  fetch-depth: 15
            - name: Install gettext
              run: sudo apt-get install -y gettext
            - name: Generate mo files
              run: ./scripts/generate-mo --quiet
            - name: Use php ${{ matrix.php-version }}
              uses: shivammathur/setup-php@v2
              with:
                  php-version: ${{ matrix.php-version }}
                  extensions: mbstring, iconv, mysqli, zip, gd, bz2
                  coverage: xdebug
            - name: Get Composer Cache Directory
              id: composer-cache
              run: |
                echo "::set-output name=dir::$(composer config cache-files-dir)"
            - uses: actions/cache@v3
              with:
                path: ${{ steps.composer-cache.outputs.dir }}
                key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
                restore-keys: |
                  ${{ runner.os }}-composer-
            - name: Install dependencies
              run: composer install --no-interaction ${{ matrix.composer-options }}
            - name: Run php tests
              run: composer run phpunit --  --exclude-group selenium
            - name: Send coverage
              uses: codecov/codecov-action@v1
              with:
                flags: unit-${{ matrix.php-version }}-${{ matrix.os }}
                name: phpunit-${{ matrix.php-version }}-${{ matrix.os }}
            - name: Send coverage to Scrutinizer
              uses: sudo-bot/action-scrutinizer@latest
              # Do not run this step on forked versions of the main repository (example: contributor forks)
              if: github.repository == 'phpmyadmin/phpmyadmin'
              with:
                  cli-args: "--format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}"
            - name: Send coverage to Codacy
              uses: codacy/codacy-coverage-reporter-action@v1
              # Do not run this step on forked versions of the main repository (example: contributor forks)
              if: github.repository == 'phpmyadmin/phpmyadmin'
              # Upload can fail on forks or if the secret is missing
              continue-on-error: true
              with:
                project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
                coverage-reports: build/logs/clover.xml

    test-php-optional-extensions:
        name: Test on php (+ ext-${{ matrix.extension }}) ${{ matrix.php-version }} and ${{ matrix.os }}
        runs-on: ${{ matrix.os }}
        strategy:
            matrix:
                php-version: ["7.1"]
                os: [ubuntu-latest]
                extension: ["dbase", "recode"]
        steps:
            - uses: actions/checkout@v3
              with:
                  # Fetch some commits for Scrutinizer coverage upload
                  fetch-depth: 15
            - name: Install gettext
              run: sudo apt-get install -y gettext
            - name: Generate mo files
              run: ./scripts/generate-mo --quiet
            - name: Use php ${{ matrix.php-version }}
              uses: shivammathur/setup-php@v2
              with:
                  php-version: ${{ matrix.php-version }}
                  extensions: ${{ matrix.extension }}, mbstring, iconv, mysqli, zip, gd
                  coverage: xdebug
            - name: Get Composer Cache Directory
              id: composer-cache
              run: |
                echo "::set-output name=dir::$(composer config cache-files-dir)"
            - uses: actions/cache@v3
              with:
                path: ${{ steps.composer-cache.outputs.dir }}
                key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
                restore-keys: |
                  ${{ runner.os }}-composer-
            - name: Install dependencies
              run: composer install
            - name: Run php tests
              run: composer run phpunit --  --exclude-group selenium
            - name: Send coverage
              uses: codecov/codecov-action@v1
              with:
                flags: ${{ matrix.extension }}-extension
                name: php-7.1-${{ matrix.extension }}-enabled
            - name: Send coverage to Scrutinizer
              uses: sudo-bot/action-scrutinizer@latest
              # Do not run this step on forked versions of the main repository (example: contributor forks)
              if: github.repository == 'phpmyadmin/phpmyadmin'
              with:
                  cli-args: "--format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}"
            - name: Send coverage to Codacy
              uses: codacy/codacy-coverage-reporter-action@v1
              # Do not run this step on forked versions of the main repository (example: contributor forks)
              if: github.repository == 'phpmyadmin/phpmyadmin'
              # Upload can fail on forks or if the secret is missing
              continue-on-error: true
              with:
                project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
                coverage-reports: build/logs/clover.xml

    test-php-random:
        name: Test (random) on php ${{ matrix.php-version }} and ${{ matrix.os }}
        runs-on: ${{ matrix.os }}
        strategy:
            matrix:
                php-version: ["7.4"]
                os: [ubuntu-latest]
        steps:
            - uses: actions/checkout@v3
            - name: Install gettext
              run: sudo apt-get install -y gettext
            - name: Generate mo files
              run: ./scripts/generate-mo --quiet
            - name: Use php ${{ matrix.php-version }}
              uses: shivammathur/setup-php@v2
              with:
                  php-version: ${{ matrix.php-version }}
                  extensions: mbstring, iconv, mysqli, zip, gd, bz2
            - name: Get Composer Cache Directory
              id: composer-cache
              run: |
                echo "::set-output name=dir::$(composer config cache-files-dir)"
            - uses: actions/cache@v3
              with:
                path: ${{ steps.composer-cache.outputs.dir }}
                key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
                restore-keys: |
                  ${{ runner.os }}-composer-
            - name: Install dependencies
              run: composer install
            - name: Run random php tests
              # This one is allowed to fail, but we hope it will not
              continue-on-error: true
              run: composer run phpunit --  --exclude-group selenium --order-by=random --stop-on-failure

    test-js:
        name: Test javascript files
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v3
            - uses: actions/setup-node@v1
              with:
                  node-version: 12
            - name: Get yarn cache directory path
              id: yarn-cache-dir-path
              run: echo "::set-output name=dir::$(yarn cache dir)"
            - name: yarn cache
              uses: actions/cache@v3
              with:
                  path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
                  key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
                  restore-keys: |
                      ${{ runner.os }}-yarn-
            - name: Install modules
              run: yarn install --non-interactive
            - name: Run tests
              run: yarn test