Skip to content

Commit 798cfe6

Browse files
authored
Merge pull request #91 from matomo-org/replace-travis-CI
Replace Travis CI with Github Actions
2 parents cc81cf5 + 53971f8 commit 798cfe6

17 files changed

Lines changed: 166 additions & 1727 deletions

File tree

.github/config.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
$MATOMO_URL = 'http://localhost:8080/tests/server/';
4+
5+
$PROXY_URL = 'http://proxy:8080/';
6+
7+
$TOKEN_AUTH = 'xyz';
8+
9+
$timeout = 5;

.github/workflows/main.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: PHPUnit
2+
3+
on: pull_request
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
build:
10+
name: PHPUnit
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
php-version: ['7.2','7.3','7.4','8.0','8.1','8.4']
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
- name: Install PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: ${{ matrix.php-version }}
22+
- name: Update package lists
23+
run: sudo apt-get update
24+
- name: Setup Apache
25+
uses: thunder/apache-shiva-php-action@81bccd449b62dcf7dae2b33a21749fceeb2401e8
26+
with:
27+
php-version: '${{ matrix.php-version }}'
28+
site-directory: ${{ github.workspace }}
29+
http-port: 8080
30+
- name: Copy config file
31+
run: cp .github/config.php config.php
32+
- name: Composer install
33+
run: composer install
34+
- name: PHPUnit / PHP ${{ matrix.php-version }}
35+
run: composer test

.github/workflows/phpcs.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: PHPCS
2+
3+
on: pull_request
4+
5+
permissions:
6+
actions: read
7+
checks: read
8+
contents: read
9+
deployments: none
10+
issues: read
11+
packages: none
12+
pull-requests: read
13+
repository-projects: none
14+
security-events: none
15+
statuses: read
16+
17+
jobs:
18+
phpcs:
19+
name: PHPCS
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
lfs: false
25+
persist-credentials: false
26+
- name: Setup PHP
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: '7.2'
30+
tools: cs2pr
31+
- name: Install dependencies
32+
run: composer install
33+
- name: Check PHP code styles
34+
id: phpcs
35+
run: ./vendor/bin/phpcs --report-full --report-checkstyle=./phpcs-report.xml
36+
- name: Show PHPCS results in PR
37+
if: ${{ always() && steps.phpcs.outcome == 'failure' }}
38+
run: cs2pr ./phpcs-report.xml

.travis.yml

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

Vagrantfile

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

composer.json

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,30 @@
1010
"homepage": "https://matomo.org/team/"
1111
}
1212
],
13+
"repositories": [
14+
{
15+
"type": "vcs",
16+
"url": "https://github.com/matomo-org/matomo-coding-standards.git"
17+
}
18+
],
1319
"require": {
20+
"php": ">=7.2"
1421
},
1522
"require-dev": {
16-
"phpunit/phpunit": "^4.8.36",
17-
"guzzlehttp/guzzle": "^5.0"
23+
"phpunit/phpunit": "^8.5 || ^9.3 || ^10.1",
24+
"matomo-org/matomo-coding-standards": "dev-master",
25+
"guzzlehttp/guzzle": "^6.5",
26+
"squizlabs/php_codesniffer": "^3.9"
1827
},
1928
"scripts": {
2029
"test": [
2130
"phpunit tests/"
2231
]
2332
},
2433
"config": {
25-
"sort-packages": true
34+
"sort-packages": true,
35+
"allow-plugins": {
36+
"dealerdirect/phpcodesniffer-composer-installer": true
37+
}
2638
}
2739
}

0 commit comments

Comments
 (0)