Skip to content

Commit 1521b40

Browse files
committed
Merge branch 'v1.8'
* v1.8: PHPLIB-606: Move CI checks from travis-ci to GitHub Actions (#802)
2 parents aedc588 + ec2f3ca commit 1521b40

File tree

10 files changed

+178
-339
lines changed

10 files changed

+178
-339
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: "Coding Standards"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "v*.*"
7+
- "master"
8+
push:
9+
branches:
10+
- "v*.*"
11+
- "master"
12+
13+
jobs:
14+
coding-standards:
15+
name: "Coding Standards"
16+
runs-on: "ubuntu-20.04"
17+
18+
strategy:
19+
matrix:
20+
php-version:
21+
- "7.4"
22+
23+
steps:
24+
- name: "Checkout"
25+
uses: "actions/checkout@v2"
26+
27+
- name: Setup cache environment
28+
id: extcache
29+
uses: shivammathur/cache-extensions@v1
30+
with:
31+
php-version: ${{ matrix.php-version }}
32+
extensions: "mongodb"
33+
key: "extcache-v1"
34+
35+
- name: Cache extensions
36+
uses: actions/cache@v2
37+
with:
38+
path: ${{ steps.extcache.outputs.dir }}
39+
key: ${{ steps.extcache.outputs.key }}
40+
restore-keys: ${{ steps.extcache.outputs.key }}
41+
42+
- name: "Install PHP"
43+
uses: "shivammathur/setup-php@v2"
44+
with:
45+
coverage: "none"
46+
extensions: "mongodb"
47+
php-version: "${{ matrix.php-version }}"
48+
tools: "cs2pr"
49+
50+
- name: "Show driver information"
51+
run: "php --ri mongodb"
52+
53+
- name: "Cache dependencies installed with Composer"
54+
uses: "actions/cache@v2"
55+
with:
56+
path: "~/.composer/cache"
57+
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
58+
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
59+
60+
- name: "Require doctrine/coding-standard"
61+
run: "composer require --no-update doctrine/coding-standard=^6.0"
62+
63+
- name: "Install dependencies with Composer"
64+
run: "composer install --no-interaction --no-progress --no-suggest"
65+
66+
# The -q option is required until phpcs v4 is released
67+
- name: "Run PHP_CodeSniffer"
68+
run: "vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr"

.github/workflows/tests.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: "Tests"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "v*.*"
7+
- "master"
8+
push:
9+
branches:
10+
- "v*.*"
11+
- "master"
12+
13+
jobs:
14+
phpunit:
15+
name: "PHPUnit tests"
16+
runs-on: "${{ matrix.os }}"
17+
18+
strategy:
19+
fail-fast: true
20+
matrix:
21+
os:
22+
- "ubuntu-20.04"
23+
php-version:
24+
- "7.4"
25+
- "8.0"
26+
mongodb-version:
27+
- "4.4"
28+
driver-version:
29+
- "stable"
30+
topology:
31+
- "server"
32+
include:
33+
- os: "ubuntu-20.04"
34+
php-version: "8.0"
35+
mongodb-version: "4.4"
36+
driver-version: "stable"
37+
topology: "replica_set"
38+
- os: "ubuntu-20.04"
39+
php-version: "8.0"
40+
mongodb-version: "4.4"
41+
driver-version: "stable"
42+
topology: "sharded_cluster"
43+
44+
steps:
45+
- name: "Checkout"
46+
uses: "actions/checkout@v2"
47+
with:
48+
fetch-depth: 2
49+
50+
- id: setup-mongodb
51+
uses: mongodb-labs/drivers-evergreen-tools@master
52+
with:
53+
version: ${{ matrix.mongodb-version }}
54+
topology: ${{ matrix.topology }}
55+
56+
- name: Setup cache environment
57+
id: extcache
58+
uses: shivammathur/cache-extensions@v1
59+
with:
60+
php-version: ${{ matrix.php-version }}
61+
extensions: "mongodb-${{ matrix.driver-version }}"
62+
key: "extcache-v1"
63+
64+
- name: Cache extensions
65+
uses: actions/cache@v2
66+
with:
67+
path: ${{ steps.extcache.outputs.dir }}
68+
key: ${{ steps.extcache.outputs.key }}
69+
restore-keys: ${{ steps.extcache.outputs.key }}
70+
71+
- name: "Install PHP"
72+
uses: "shivammathur/setup-php@v2"
73+
with:
74+
php-version: "${{ matrix.php-version }}"
75+
tools: "pecl"
76+
extensions: "mongodb-${{ matrix.driver-version }}"
77+
coverage: "none"
78+
ini-values: "zend.assertions=1"
79+
80+
- name: "Show driver information"
81+
run: "php --ri mongodb"
82+
83+
- name: "Cache dependencies installed with composer"
84+
uses: "actions/cache@v2"
85+
with:
86+
path: "~/.composer/cache"
87+
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
88+
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
89+
90+
- name: "Install dependencies with composer"
91+
run: "composer update --no-interaction --no-progress"
92+
93+
- name: "Run PHPUnit"
94+
run: "vendor/bin/simple-phpunit -v"
95+
env:
96+
SYMFONY_DEPRECATIONS_HELPER: 999999
97+
MONGODB_URI: ${{ steps.setup-mongodb.outputs.cluster-uri }}

.travis.yml

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

.travis/debug-core.sh

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

.travis/get_uri.php

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

.travis/install-extension.sh

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

0 commit comments

Comments
 (0)