Skip to content

Commit 4183d49

Browse files
committed
Add Github Action
1 parent 0069122 commit 4183d49

File tree

6 files changed

+160
-8
lines changed

6 files changed

+160
-8
lines changed

.github/workflows/actions.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Build
2+
on: [push]
3+
jobs:
4+
check:
5+
runs-on: ubuntu-latest
6+
name: Check CodingStyle
7+
continue-on-error: true
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v2
11+
- name: Setup PHP
12+
uses: shivammathur/setup-php@v2
13+
with:
14+
php-version: "7.4"
15+
tools: phive
16+
- name: Install CS-Fixer
17+
run: phive install --trust-gpg-keys E82B2FB314E9906E php-cs-fixer
18+
- name: Run CS-Check
19+
run: composer fix-dry
20+
test:
21+
needs: check
22+
runs-on: ubuntu-latest # ${{ matrix.operating-system }}
23+
continue-on-error: ${{ matrix.experimental }}
24+
strategy:
25+
matrix:
26+
# operating-system: [ubuntu-latest, windows-latest, macos-latest]
27+
php-versions: ['7.3', '7.4', '8.0']
28+
experimental: [false]
29+
include:
30+
- php-versions: '8.1'
31+
experimental: true
32+
name: PHP ${{ matrix.php-versions }} # Test on ${{ matrix.operating-system }}
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v2
36+
- name: Setup PHP
37+
uses: shivammathur/setup-php@v2
38+
with:
39+
php-version: ${{ matrix.php-versions }}
40+
extensions: sodium
41+
tools: phive
42+
- name: prepare
43+
run: composer update
44+
- name: Download phpunit
45+
run: phive --no-progress install --trust-gpg-keys 4AA394086372C20A phpunit
46+
- name: test
47+
run: composer test
48+
analyze:
49+
#needs: test
50+
runs-on: ubuntu-latest
51+
continue-on-error: false
52+
steps:
53+
- name: Checkout
54+
uses: actions/checkout@v2
55+
- name: Setup PHP
56+
uses: shivammathur/setup-php@v2
57+
with:
58+
php-version: "7.4"
59+
tools: phive
60+
- name: Download psalm
61+
run: phive --no-progress install --trust-gpg-keys 8A03EA3B385DBAA1 psalm
62+
- name: install
63+
run: composer update
64+
- name: analyze
65+
run: ./tools/psalm
66+
coverage:
67+
# needs: test
68+
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
69+
runs-on: ubuntu-latest
70+
continue-on-error: false
71+
steps:
72+
- name: Checkout
73+
uses: actions/checkout@v2
74+
- name: Setup PHP
75+
uses: shivammathur/setup-php@v2
76+
with:
77+
php-version: "7.4"
78+
coverage: xdebug
79+
tools: phive
80+
- name: Download phpunit
81+
run: phive --no-progress install --trust-gpg-keys 4AA394086372C20A phpunit
82+
- name: Install
83+
run: composer update
84+
- name: run testsuite
85+
run: composer test-coverage
86+
- name: Upload coverage results to Coveralls
87+
env:
88+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
run: |
90+
composer global require php-coveralls/php-coveralls
91+
php-coveralls --coverage_clover=clover.xml -v

build/psalm/baseline.xml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<files psalm-version="3.18.2@19aa905f7c3c7350569999a93c40ae91ae4e1626">
3+
<file src="src/ConfiguredMediator.php">
4+
<PossiblyNullArgument occurrences="1">
5+
<code>$config-&gt;keyDirectory()</code>
6+
</PossiblyNullArgument>
7+
</file>
8+
<file src="src/IteratorImplementation.php">
9+
<DocblockTypeContradiction occurrences="1">
10+
<code>false === key($this-&gt;getList())</code>
11+
</DocblockTypeContradiction>
12+
</file>
13+
<file src="src/PackageVersion.php">
14+
<MissingPropertyType occurrences="3">
15+
<code>$name</code>
16+
<code>$semver</code>
17+
<code>$versionString</code>
18+
</MissingPropertyType>
19+
<UndefinedInterfaceMethod occurrences="1">
20+
<code>getReason</code>
21+
</UndefinedInterfaceMethod>
22+
<UndefinedMethod occurrences="2">
23+
<code>getInstalledRepo</code>
24+
<code>getJob</code>
25+
</UndefinedMethod>
26+
</file>
27+
<file src="src/PluginBase.php">
28+
<MissingPropertyType occurrences="2">
29+
<code>$composer</code>
30+
<code>$io</code>
31+
</MissingPropertyType>
32+
<MissingReturnType occurrences="3">
33+
<code>activate</code>
34+
<code>deactivate</code>
35+
<code>uninstall</code>
36+
</MissingReturnType>
37+
</file>
38+
<file src="src/SemanticVersion.php">
39+
<TypeDoesNotContainType occurrences="1">
40+
<code>$b</code>
41+
</TypeDoesNotContainType>
42+
</file>
43+
<file src="src/Service/Installer.php">
44+
<PossiblyNullReference occurrences="1">
45+
<code>toString</code>
46+
</PossiblyNullReference>
47+
<UndefinedClass occurrences="1">
48+
<code>$factory-&gt;createGnuPG(new Directory(sys_get_temp_dir()))</code>
49+
</UndefinedClass>
50+
</file>
51+
<file src="src/Service/Verify.php">
52+
<UndefinedClass occurrences="1">
53+
<code>GnuPG</code>
54+
</UndefinedClass>
55+
<UndefinedDocblockClass occurrences="2">
56+
<code>$this-&gt;gpg</code>
57+
<code>Gnupg</code>
58+
</UndefinedDocblockClass>
59+
</file>
60+
<file src="src/Url.php">
61+
<TypeDoesNotContainType occurrences="2">
62+
<code>$parts['port'] === ''</code>
63+
<code>$parts['port'] === ''</code>
64+
</TypeDoesNotContainType>
65+
</file>
66+
</files>

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@
4747
"phar-io/filesystem": "^0.9"
4848
},
4949
"require-dev": {
50-
"phpunit/phpunit": "^9.4",
5150
"composer/composer": "^2.0"
5251
},
5352
"scripts": {
5453
"test": "tools/phpunit --testsuite=default",
54+
"test-coverage": "tools/phpunit --coverage-clover clover.xml",
5555
"test-all": "tools/phpunit",
5656
"fix": "tools/php-cs-fixer fix",
5757
"fix-dry": "tools/php-cs-fixer fix --dry-run"

psalm.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,9 @@
1111
<directory name="src"/>
1212
<ignoreFiles>
1313
<directory name="vendor"/>
14-
<file name="src/autoload.php"/>
1514
</ignoreFiles>
1615
</projectFiles>
1716

18-
<stubs>
19-
<file name="./build/phpstan/bootstrap.php"/>
20-
</stubs>
21-
2217
<issueHandlers>
2318
<LessSpecificReturnType errorLevel="info"/>
2419

tests/integration/_assets/installWithFaultySignature.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="https://phar.io/xml/distributor/1.0/schema.xsd"
55
packageName="foo/bar"
6-
keyDirectory="tests/integration/_assets/faultykeys">
6+
keyDirectory="faultykeys">
77

88
<phar name="foo"
99
file="https://github.com/heiglandreas/JUnitDiff/releases/download/0.5.0/junitdiff.phar"

tests/integration/_assets/installWithSignature.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="https://phar.io/xml/distributor/1.0/schema.xsd"
55
packageName="foo/bar"
6-
keyDirectory="tests/integration/_assets/keys">
6+
keyDirectory="keys">
77

88
<phar name="foo"
99
file="https://github.com/heiglandreas/JUnitDiff/releases/download/0.5.0/junitdiff.phar"

0 commit comments

Comments
 (0)