Skip to content

Commit ad730d4

Browse files
committed
Migrate to GitHub Actions
1 parent 295eed1 commit ad730d4

3 files changed

Lines changed: 80 additions & 37 deletions

File tree

.github/workflows/ci.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Continuous Integration
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
tests:
9+
strategy:
10+
matrix:
11+
include:
12+
- operating-system: 'ubuntu-latest'
13+
php-version: '8.0'
14+
15+
- operating-system: 'ubuntu-latest'
16+
php-version: '8.1'
17+
18+
- operating-system: 'windows-latest'
19+
php-version: '8.1'
20+
job-description: 'on Windows'
21+
22+
- operating-system: 'macos-latest'
23+
php-version: '8.1'
24+
job-description: 'on macOS'
25+
26+
name: PHP ${{ matrix.php-version }} ${{ matrix.job-description }}
27+
28+
runs-on: ${{ matrix.operating-system }}
29+
30+
steps:
31+
- name: Set git to use LF
32+
run: |
33+
git config --global core.autocrlf false
34+
git config --global core.eol lf
35+
36+
- name: Checkout code
37+
uses: actions/checkout@v2
38+
39+
- name: Setup PHP
40+
uses: shivammathur/setup-php@v2
41+
with:
42+
php-version: ${{ matrix.php-version }}
43+
extensions: fiber-amphp/ext-fiber@master
44+
45+
- name: Get Composer cache directory
46+
id: composer-cache
47+
run: echo "::set-output name=dir::$(composer config cache-dir)"
48+
49+
- name: Cache dependencies
50+
uses: actions/cache@v2
51+
with:
52+
path: ${{ steps.composer-cache.outputs.dir }}
53+
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}-${{ matrix.composer-flags }}
54+
restore-keys: |
55+
composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}-
56+
composer-${{ runner.os }}-${{ matrix.php-version }}-
57+
composer-${{ runner.os }}-
58+
composer-
59+
60+
- name: Install dependencies
61+
uses: nick-invision/retry@v2
62+
with:
63+
timeout_minutes: 5
64+
max_attempts: 5
65+
retry_wait_seconds: 30
66+
command: |
67+
composer update --optimize-autoloader --no-interaction --no-progress ${{ matrix.composer-flags }}
68+
composer info -D
69+
70+
- name: Run tests
71+
run: vendor/bin/phpunit ${{ matrix.phpunit-flags }}
72+
73+
- name: Run style fixer
74+
env:
75+
PHP_CS_FIXER_IGNORE_ENV: 1
76+
run: vendor/bin/php-cs-fixer --diff --dry-run -v fix

.travis.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,16 @@
1616
"support": {
1717
"issues": "https://github.com/amphp/phpunit-util/issues"
1818
},
19+
"minimum-stability": "beta",
20+
"prefer-stable": true,
1921
"require": {
2022
"php": ">=8",
2123
"ext-json": "*",
22-
"revolt/event-loop": "v1.x-dev",
24+
"amphp/amp": "^3",
25+
"revolt/event-loop": "^0.1",
2326
"phpunit/phpunit": "^9"
2427
},
2528
"require-dev": {
26-
"amphp/amp": "v3.x-dev",
2729
"amphp/php-cs-fixer-config": "dev-master"
2830
},
2931
"autoload": {

0 commit comments

Comments
 (0)