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

ci.yml « workflows « .github - github.com/YOURLS/YOURLS.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: dcf3a7930db65f8bbf6f6c43589e2f4f119bd7fc (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
name: CI

on:
  push:
  pull_request:
    branches: [ master ]

jobs:
  test:
    name: PHP
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        php: ['8.0', '8.1']
        phpunit: ['latest']
        include:
        - php: '7.4'
          phpunit: '8.5.13'
          coverage: xdebug
          flags: '--coverage-clover clover.xml'

    services:
      mysql:
        image: mariadb
        ports:
          - 3306/tcp
        env:
          MYSQL_ALLOW_EMPTY_PASSWORD: false
          MYSQL_ROOT_PASSWORD: secret
          MYSQL_DATABASE: yourls_tests
        options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

    steps:
    - uses: actions/checkout@v3

    - name: Use PHP ${{ matrix.php }}
      uses: shivammathur/setup-php@2.19.1
      with:
        php-version: ${{ matrix.php }}
        extensions: mbstring, curl, zip, dom, simplexml, intl, pdo_mysql
        tools: phpunit:${{ matrix.phpunit }}
        coverage: ${{ matrix.coverage }}

    # - name: Validate composer.json and composer.lock
    #   run: composer validate

    # - name: Cache Composer packages
    #   id: composer-cache
    #   uses: actions/cache@v2
    #   with:
    #     path: vendor
    #     key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
    #     restore-keys: |
    #       ${{ runner.os }}-php-

    # - name: Install dependencies
    #   if: steps.composer-cache.outputs.cache-hit != 'true'
    #   run: composer install --prefer-dist --no-progress --no-suggest
    #   env:
    #     APP_ENV: testing

    # - name: Lint
    #   run: composer run-script lint

    - name: Prepare the application
      run: |
        git clone https://github.com/ozh/YOURLS-fr_FR.git user/languages/fr
        cp user/languages/fr/fr_FR.* user/languages
        cp tests/data/config/yourls-tests-config-ci.php user/config.php

    - name: Test
      run: phpunit --configuration phpunit.xml.dist ${{ matrix.flags }}
      env:
        DB_PORT: ${{ job.services.mysql.ports['3306'] }}