Skip to content

Commit ab6f76d

Browse files
authored
CI workflow update (#13)
1 parent 224766f commit ab6f76d

File tree

7 files changed

+26
-273
lines changed

7 files changed

+26
-273
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,13 @@
1-
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
1+
name: CI
22

33
on:
44
push:
5-
branches: [ '**' ]
65
pull_request:
7-
branches: [ '**' ]
8-
9-
name: "CI"
6+
workflow_dispatch:
107

118
jobs:
12-
tests:
13-
name: "Tests"
14-
15-
runs-on: "ubuntu-latest"
16-
17-
env:
18-
php_extensions: ctype, dom, fileinfo, hash, intl, mbstring, session, simplexml, tokenizer, xml, pdo, mysqli, gd, zip
19-
20-
services:
21-
mysql:
22-
image: "mysql:5.7"
23-
env:
24-
MYSQL_ALLOW_EMPTY_PASSWORD: true
25-
MYSQL_ROOT_PASSWORD:
26-
MYSQL_DATABASE: test_db
27-
ports:
28-
- 3306/tcp
29-
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
30-
31-
strategy:
32-
fail-fast: false
33-
matrix:
34-
php-version:
35-
- "7.4"
36-
- "8.0"
37-
- "8.1"
38-
39-
steps:
40-
- name: "Checkout"
41-
uses: "actions/checkout@v2"
42-
43-
- name: "Install PHP with extensions"
44-
uses: "shivammathur/setup-php@v2"
45-
with:
46-
php-version: "${{ matrix.php-version }}"
47-
extensions: "${{ env.php_extensions }}"
48-
coverage: "xdebug"
49-
50-
- name: "Start mysql service"
51-
run: "sudo /etc/init.d/mysql start"
52-
53-
- name: "Cache dependencies installed with composer"
54-
uses: "actions/cache@v1"
55-
with:
56-
path: "~/.composer/cache"
57-
key: "php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}"
58-
restore-keys: "php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
59-
60-
- name: "Install dependencies with composer"
61-
run: "composer install --no-ansi --no-interaction --no-progress"
62-
63-
- name: "Run tests with phpunit/phpunit"
64-
env:
65-
SS_DATABASE_PORT: ${{ job.services.mysql.ports['3306'] }}
66-
run: "vendor/bin/phpunit --coverage-clover=coverage.xml"
67-
68-
- name: "Upload coverage results to CodeCov"
69-
uses: codecov/codecov-action@v1
70-
with:
71-
files: ./coverage.xml # optional
72-
flags: unittests # optional
73-
74-
- name: "Run tests with squizlabs/php_codesniffer"
75-
run: "vendor/bin/phpcs -s --report=summary --standard=phpcs.xml.dist --extensions=php,inc --ignore=autoload.php --ignore=vendor/ src/ tests/"
9+
ci:
10+
name: CI
11+
uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1
12+
with:
13+
phpcoverage: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
npm-debug.log
22
node_modules/
3+
.github/.DS_Store

.scrutinizer.yml

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

.travis.yml

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

phpcs.xml.dist

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,14 @@
1-
<?xml version="1.0"?>
2-
<ruleset name="SS4">
3-
<description>Coding standard for SilverStripe 4.x</description>
4-
5-
<!-- Don't sniff third party libraries -->
6-
<exclude-pattern>*/vendor/*</exclude-pattern>
7-
<exclude-pattern>*/thirdparty/*</exclude-pattern>
8-
9-
<!-- Show progress and output sniff names on violation, and add colours -->
10-
<arg value="sp"/>
11-
<arg name="colors"/>
12-
13-
<!-- Use PSR-2 as a base standard -->
14-
<rule ref="PSR2">
15-
<!-- Allow classes to not declare a namespace -->
16-
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace"/>
17-
18-
<!-- Allow underscores in class names -->
19-
<exclude name="Squiz.Classes.ValidClassName.NotCamelCaps"/>
20-
21-
<!-- Allow non camel cased method names -->
22-
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"/>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ruleset name="SilverStripe">
3+
<description>CodeSniffer ruleset for SilverStripe coding conventions.</description>
4+
5+
<file>src</file>
6+
<file>tests</file>
7+
8+
<!-- base rules are PSR-2 -->
9+
<rule ref="PSR2" >
10+
<!-- Current exclusions -->
11+
<exclude name="PSR1.Methods.CamelCapsMethodName" />
12+
<exclude name="PSR1.Files.SideEffects.FoundWithSymbols" />
2313
</rule>
2414
</ruleset>

phpdox.xml

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

phpunit.xml.dist

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
12
<phpunit bootstrap="vendor/silverstripe/cms/tests/bootstrap.php" colors="true">
2-
<testsuite name="dynamic/silverstripe-elemental-embedded-code">
3-
<directory>tests</directory>
4-
</testsuite>
5-
3+
<testsuites>
4+
<testsuite name="elemental-embedded-code">
5+
<directory>tests/</directory>
6+
</testsuite>
7+
</testsuites>
68
<filter>
79
<whitelist addUncoveredFilesFromWhitelist="true">
810
<directory suffix=".php">src/</directory>

0 commit comments

Comments
 (0)