-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (94 loc) · 3.06 KB
/
pull_request.yml
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
on: pull_request
name: Check and lint
jobs:
php_version:
name: Lookup PHP version
runs-on: ubuntu-latest
outputs:
php_version: ${{ env.php_version }}
steps:
- uses: actions/checkout@v4
- name: Lookup PHP version
run: echo "php_versions=$(jq -r .config.platform.php)" >> "$GITHUB_ENV"
review_codestyle:
name: Codestyle
runs-on: ubuntu-latest
needs: php_version
steps:
- uses: actions/checkout@v4
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master
with:
php-version: ${{ needs.php_version.outputs.php_version }}
coverage: none
- name: Install Dependencies
run: composer install --no-interaction --no-progress
- name: Run phpcs
uses: reload/action-phpcs@main
with:
reviewdog_token: ${{ secrets.GITHUB_TOKEN }}
static_code_analysis:
name: Static Code Analysis
runs-on: ubuntu-latest
needs: php_version
steps:
- uses: actions/checkout@v4
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master
with:
php-version: ${{ needs.php_version.outputs.php_version }}
coverage: none
- name: Install Reviewdog
run: |
wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s -- -b "$PWD/" latest
- name: Install Dependencies
run: |
composer install --no-interaction --no-progress
- name: Static code analysis
run: |
php -d memory_limit=1G vendor/bin/phpstan analyse . --error-format=checkstyle | ./reviewdog -f=checkstyle -name=PHPStan -reporter=github-pr-check
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
unit_tests:
name: PHPUnit tests
runs-on: ubuntu-latest
needs: php_version
steps:
- uses: actions/checkout@v4
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master
with:
php-version: ${{ needs.php_version.outputs.php_version }}
coverage: none
- name: Install Dependencies
run: |
composer install --no-interaction --no-progress
- name: Unit tests
run: |
vendor/bin/phpunit
hadolint:
name: Hadolint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hadolint/[email protected]
markdown_lint:
name: Markdown lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install problem matcher
uses: xt0rted/markdownlint-problem-matcher@v3
- name: Lint README.md file
uses: nosborn/[email protected]
with:
files: './README.md'
docker_build:
name: Test Docker build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build docker image
run: docker build -t reload/drupal-security-jira:test .
- name: Test image
run: docker run --rm reload/drupal-security-jira:test --version