-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (59 loc) · 2.39 KB
/
test-and-publish.yml
File metadata and controls
71 lines (59 loc) · 2.39 KB
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
name: test-and-publish
on: [ push, pull_request ]
jobs:
test-and-publish:
name: '[PHP ${{ matrix.php-version }} Tests and Publish'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: [ 7.4, 8.0, 8.1 ]
steps:
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v2
- uses: actions/checkout@v2
with:
clean: false
- name: Cache composer
uses: actions/cache@v2
with:
path: ~/vendor/
key: php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.json') }}
restore-keys: |
php-${{ matrix.php-version }}
php-${{ matrix.php-version }}
- name: before install
run: |
phpenv config-rm xdebug.ini || true
export PATH=$PATH:$HOME/.config/composer/vendor/bin:$HOME/.composer/vendor/bin
- name: Composer install
run: |
if ( [ "${{ matrix.php-version }}" == "8.1" ] ); then composer global require humbug/box:^3.16 --ignore-platform-reqs; else composer global require humbug/box; fi
composer update
- name: script
run: |
composer validate --strict
vendor/bin/ecs check -- ecs.php tests/
- name: after success
run: |
cp ./ecs.php ./build/ecs${{ matrix.php-version }}.php
- name: before deploy
run: |
box compile
./build/ecs-standalone.phar check -- ecs.php tests/
mv ./build/ecs-standalone.phar ./build/coding-standard-standalone.ecs.php${{ matrix.php-version }}.phar
- name: deploy
if:
contains('
refs/heads/master
', github.ref)
uses: shallwefootball/s3-upload-action@master
id: S3
with:
aws_key_id: ${{ secrets.S3_BUILD_ACCESS_KEY }}
aws_secret_access_key: ${{ secrets.S3_BUILD_SECRET_KEY }}
aws_bucket: ${{ secrets.S3_BUILD_BUCKET }}
source_dir: 'build'
destination_dir: 'phar'