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

coding_standards.yml « workflows « .github - github.com/HuasoFoundries/phpPgAdmin6.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 08a4117ac9e24664fa7f180d60208576fc931ef2 (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
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

name: "Coding_Standards"

on:
  push:
    branches:
      - master
      - develop
  pull_request:
    branches:
      - master
      - develop

env:
  MIN_COVERED_MSI: 100
  MIN_MSI: 100
  PHP_EXTENSIONS: "mbstring, pgsql"
  key: cache-v1 # can be any string, change to clear the extension cache.
jobs:
  coding_standards:
    name: "Coding_Standards"

    runs-on: "ubuntu-latest"

    strategy:
      matrix:
        php_version:
          - "7.3"

        dependencies:
          - "locked"

    steps:
      - name: "Checkout"
        uses: "actions/checkout@v2.3.3"

      - name: Setup cache environment
        id: extcache
        uses: shivammathur/cache-extensions@v1
        with:
          php-version: ${{ matrix.php_version }}
          extensions: ${{ env.PHP_EXTENSIONS }}
          key: ${{ env.key }}

      - name: Cache extensions
        uses: "actions/cache@v2.1.1"
        with:
          path: ${{ steps.extcache.outputs.dir }}
          key: ${{ steps.extcache.outputs.key }}
          restore-keys: ${{ steps.extcache.outputs.key }}

      - name: "Install PHP with extensions"
        uses: "shivammathur/setup-php@v2.5.0"
        with:
          coverage: "none"
          extensions: "${{ env.PHP_EXTENSIONS }}"
          php-version: "${{ matrix.php_version }}"
          tools: composer

      - name: Cache Composer
        uses: "actions/cache@v2.1.1"
        with:
          path: "~/.composer/cache"
          key: "composer-${{ hashFiles('composer.lock') }}"
          restore-keys: "composer-"

      - name: "Install locked dependencies from composer.lock"
        run: "composer install --no-interaction --no-progress --no-suggest"

      - name: "Run ergebnis/composer-normalize"
        run: "composer normalize --dry-run"

      - name: "Create cache directory for friendsofphp/php-cs-fixer"
        run: "mkdir -p .build/php-cs-fixer"

      - name: "Cache cache directory for friendsofphp/php-cs-fixer"
        uses: "actions/cache@v2.1.1"
        with:
          path: ".build/php-cs-fixer"
          key: "php-${{ matrix.php_version }}-php-cs-fixer-${{ hashFiles('composer.lock') }}"
          restore-keys: "php-${{ matrix.php_version }}-php-cs-fixer-"

      - name: "Run friendsofphp/php-cs-fixer"
        run: "vendor/bin/php-cs-fixer fix --config=.php_cs.php --diff --diff-format=udiff --dry-run --verbose"