-
Notifications
You must be signed in to change notification settings - Fork 191
89 lines (82 loc) · 2.63 KB
/
main.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
name: CI
on: [push]
jobs:
phpcs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Composer install
run: composer update --no-progress --ignore-platform-reqs
- name: PHPCS
run: |
composer require friendsofphp/php-cs-fixer
./vendor/bin/php-cs-fixer fix src
./vendor/bin/php-cs-fixer fix tests
- name: Auto Commit
if: github.event.head_commit.author.name != 'PHP CS Fixer'
run: |
git remote set-url origin https://eXorus:${{ secrets.GITHUB_TOKEN }}@github.com/php-mime-mail-parser/php-mime-mail-parser
git config --global user.email "you@example.com"
git config --global user.name "PHP CS Fixer"
git checkout auto-commit
git status
git add .
git status
git commit -m "test fixer" || echo "No changes found. Nothing to commit."
git status
git push
one:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Dump strategy context
env:
STRATEGY_CONTEXT: ${{ toJson(strategy) }}
run: echo "$STRATEGY_CONTEXT"
- name: Dump matrix context
env:
MATRIX_CONTEXT: ${{ toJson(matrix) }}
run: echo "$MATRIX_CONTEXT"
- name: Dump job context
env:
JOB_CONTEXT: ${{ toJson(job) }}
run: echo "$JOB_CONTEXT"
- name: Dump runner context
env:
RUNNER_CONTEXT: ${{ toJson(runner) }}
run: echo "$RUNNER_CONTEXT"
- name: Dump steps context
env:
STEPS_CONTEXT: ${{ toJson(steps) }}
run: echo "$STEPS_CONTEXT"
build:
runs-on: ubuntu-latest
strategy:
matrix:
php: [7.1, 7.2, 7.3]
composer: ["", "--prefer-lowest"]
steps:
- uses: actions/checkout@v1
- name: Change PHP version
run: sudo update-alternatives --set php /usr/bin/php${{ matrix.php }}
- name: Install mailparse
run: sudo apt install php-mailparse
- name: Composer install
run: composer update ${{ matrix.composer }} --no-progress
- name: PHP Version
run: php -v
- name: PhpUnit
run: |
mkdir -p build/logs
./vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml -c phpunit.xml.dist --whitelist src
- name: PHPCS
run: |
./vendor/bin/phpcs src --standard=psr2
./vendor/bin/phpcs tests --standard=psr2
- name: Coveralls
env:
COVERALLS_REPO_TOKEN: BS4E6dtQa8fUMHQiOTFbQICA6ydxSqkRt
run: ./vendor/bin/php-coveralls -v