aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/bshaffer/oauth2-server-php/.github/workflows/tests.yml
blob: fe13e48b83746de5c97a4ea112d0288f9e9200f8 (plain) (blame)
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
name: Test Suite
on:
  push:
    branches:
      - main
  pull_request:
jobs:
  test:
    runs-on: ubuntu-latest
    services:
      redis:
        image: redis
        ports:
          - 6379:6379
        options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
      mongodb:
        image: mongo
        ports:
          - 27017:27017
      myriadb:
        image: mariadb
        env:
          MYSQL_ROOT_PASSWORD: root
        ports:
          - 3808:3808
          - 3306:3306
      postgres:
        image: postgres
        env:
          POSTGRES_DB: oauth2_server_php
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: postgres
        ports:
          - 5432:5432
        options: --health-cmd="pg_isready -h localhost" --health-interval=10s --health-timeout=5s --health-retries=5
    strategy:
      matrix:
        php: [ 7.2, 7.3, 7.4, "8.0", 8.1, 8.2 ]
    name: "PHP ${{ matrix.php }} Unit Test"
    steps:
      - uses: actions/checkout@v2
      - uses: codecov/codecov-action@v1
      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}
          extensions: mongodb, mbstring, intl, redis, pdo_mysql
      - name: Install composer dependencies
        uses: nick-invision/retry@v1
        with:
          timeout_minutes: 10
          max_attempts: 3
          command: composer install
      - name: Run PHPUnit
        run: vendor/bin/phpunit -v
  phpstan:
    name: "PHPStan"
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: 8.1
      - name: Install composer dependencies
        uses: nick-invision/retry@v1
        with:
          timeout_minutes: 10
          max_attempts: 3
          command: composer install
      - name: Run PHPStan
        run: |
          composer require phpstan/phpstan
          vendor/bin/phpstan analyse --level=0 src/