Skip to content

Commit fa1432e

Browse files
committed
Use Github actions instead of Travis CI (#278)
1 parent 8f61d20 commit fa1432e

File tree

4 files changed

+113
-48
lines changed

4 files changed

+113
-48
lines changed

Diff for: .editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ trim_trailing_whitespace = false
2424
[*.yml]
2525
trim_trailing_whitespace = false
2626

27-
[.travis.yml]
27+
[.github/workflows/*.yml]
2828
indent_size = 2
2929

3030
[composer.json]

Diff for: .github/workflows/ci.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: CI
2+
3+
on:
4+
- push
5+
6+
jobs:
7+
build:
8+
name: Build and Test
9+
runs-on: ubuntu-latest
10+
env:
11+
extensions: json
12+
composer_version: 2
13+
strategy:
14+
matrix:
15+
php_version:
16+
- '7.4'
17+
- '8.0'
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- name: Get Composer Cache Directory
22+
id: composer-cache
23+
run: |
24+
echo "::set-output name=dir::$(composer config cache-files-dir)"
25+
26+
- uses: actions/cache@v2
27+
with:
28+
path: ${{ steps.composer-cache.outputs.dir }}
29+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
30+
restore-keys: |
31+
${{ runner.os }}-composer-
32+
33+
- name: Setup PHP with extensions
34+
uses: shivammathur/setup-php@v2
35+
with:
36+
php-version: ${{ matrix.php_version }}
37+
extensions: ${{ env.extensions }}
38+
ini-values: memory_limit=-1
39+
coverage: pcov
40+
tools: composer:v2, cs2pr, php-cs-fixer
41+
42+
- name: Install prerequisites
43+
run: |
44+
export PATH="$PATH:$HOME/.composer/vendor/bin"
45+
mkdir -p build/logs
46+
wget https://github.com/satooshi/php-coveralls/releases/download/v2.4.3/php-coveralls.phar
47+
wget -O box.phar https://github.com/humbug/box/releases/download/3.11.1/box.phar
48+
export BOX_BIN=$(pwd)/box.phar
49+
sudo chown -R $(whoami):$(whoami) .
50+
51+
- name: Install dependencies
52+
run: composer install --prefer-dist --no-interaction --no-progress
53+
54+
- name: Run phpunit
55+
run: vendor/bin/simple-phpunit
56+
57+
- name: Run php-cs-fixer
58+
run: php-cs-fixer fix --dry-run --format=checkstyle | cs2pr
59+
60+
- name: Run phpstan
61+
run: |
62+
vendor/bin/phpstan analyse
63+
64+
- name: Run e2e tests
65+
run: |
66+
php bin/compile

Diff for: .github/workflows/release.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
on:
2+
release:
3+
types:
4+
- published
5+
6+
name: Upload Release Asset
7+
8+
jobs:
9+
build:
10+
name: Upload Release Asset
11+
runs-on: ubuntu-latest
12+
env:
13+
extensions: json
14+
php_version: '8.0'
15+
outputs:
16+
upload_url: ${{ steps.step_upload_url.outputs.upload_url }}
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
21+
- name: Setup PHP with extensions
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: ${{ env.php_version }}
25+
extensions: ${{ env.extensions }}
26+
ini-values: memory_limit=-1
27+
tools: composer
28+
29+
- name: Download box.phar
30+
run: |
31+
wget -O box.phar https://github.com/humbug/box/releases/download/3.11.1/box.phar
32+
export BOX_BIN=$(pwd)/box.phar
33+
34+
- name: Compile project
35+
run: php ./box.phar compile;
36+
37+
- name: Upload Release Asset
38+
id: upload-release-asset
39+
uses: actions/upload-release-asset@v1
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
with:
43+
upload_url: ${{ github.event.release.upload_url }}
44+
asset_path: ./schema.phar
45+
asset_name: schema.phar
46+
asset_content_type: application/x-php

Diff for: .travis.yml

-47
This file was deleted.

0 commit comments

Comments
 (0)