Skip to content

Commit 59e80f9

Browse files
authored
Merge pull request #68 from pdsinterop/github-actions
GitHub actions QA
2 parents f0785b9 + 003d34a commit 59e80f9

27 files changed

Lines changed: 2155 additions & 1429 deletions

.github/workflows/ci.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
1+
# This workflow will do a clean install of node dependencies, build the source
2+
# code and run tests across different versions of node
3+
# For more information see:
4+
# https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
35

46
name: CI
57

@@ -16,12 +18,15 @@ jobs:
1618

1719
strategy:
1820
matrix:
19-
os: [ubuntu-latest]
21+
os: [ ubuntu-latest ]
2022

2123
steps:
22-
- uses: actions/checkout@v2
23-
# Run the Solid test-suite
24-
- name: Run the Solid test suite
25-
shell: 'script -q -e -c "bash {0}"'
26-
run: |
27-
bash ./run-solid-test-suite.sh
24+
- uses: actions/checkout@v2
25+
# Run the Solid test-suite
26+
- name: Run the Solid test suite
27+
# Until the test-suite has been fixed, allow the tests to fail.
28+
# See: https://github.com/pdsinterop/solid-nextcloud/issues/69
29+
continue-on-error: true
30+
shell: 'script -q -e -c "bash {0}"'
31+
run: |
32+
bash ./run-solid-test-suite.sh

.github/workflows/linting.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: Linting jobs
3+
4+
on:
5+
- push
6+
- pull_request
7+
8+
jobs:
9+
lint-json:
10+
runs-on: ubuntu-20.04
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: "docker://pipelinecomponents/jsonlint:latest"
14+
with:
15+
args: "find . -not -path './.git/*' -name '*.json' -type f"
16+
17+
lint-php:
18+
runs-on: ubuntu-20.04
19+
steps:
20+
- uses: actions/checkout@v2
21+
- uses: pipeline-components/php-linter@master
22+
23+
lint-markdown:
24+
runs-on: ubuntu-20.04
25+
steps:
26+
- uses: actions/checkout@v2
27+
- uses: pipeline-components/remark-lint@master
28+
with:
29+
options: --rc-path=build/.remarkrc --ignore-pattern='*/vendor/*'
30+
31+
lint-yaml:
32+
runs-on: ubuntu-20.04
33+
steps:
34+
- uses: actions/checkout@v2
35+
- uses: pipeline-components/yamllint@master
36+
with:
37+
options: --config-file=build/.yamllint
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Quality Assurance jobs
3+
4+
on:
5+
- push
6+
- pull_request
7+
8+
jobs:
9+
composer-validate:
10+
runs-on: ubuntu-20.04
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: "docker://composer"
14+
with:
15+
args: composer validate --strict --working-dir=solid/
16+
17+
php-codesniffer:
18+
runs-on: ubuntu-20.04
19+
steps:
20+
- uses: actions/checkout@v2
21+
- uses: pipeline-components/php-codesniffer@master
22+
with:
23+
options: --standard=build/phpcs.xml.dist

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM nextcloud:latest
1+
FROM nextcloud:21
22
COPY site.conf /etc/apache2/sites-enabled/000-default.conf
33
RUN a2enmod ssl
44
RUN mkdir /tls

_config.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
baseurl: /solid-nextcloud
3-
description: A plugin to make Nextcloud compatible with Solid
3+
description: A plugin to make Nextcloud compatible with Solid
44
repository: pdsinterop/solid-nextcloud
55
title: Solid Nextcloud
66
url: https://pdsinterop.org/
@@ -33,7 +33,7 @@ nav:
3333
exclude:
3434
- /
3535
- /404.html
36-
favicon_ico : /favicon.ico
36+
favicon_ico: /favicon.ico
3737
main_title:
3838
link: '/'
3939
recurse: true
@@ -42,7 +42,14 @@ nav:
4242
aux_links:
4343
"PDS Interop on GitHub":
4444
- https://github.com/pdsinterop
45-
footer_content: '<p xmlns:dct="http://purl.org/dc/terms/" property="dct:rights">Copyright © <span property="dct:dateCopyrighted">2020-2021</span> <span property="dct:publisher">PDS Interop</span>. Distributed under a <a rel="license" href="https://pdsinterop.org/license/">MIT license</a>.</p>'
45+
footer_content: |
46+
<p xmlns:dct="http://purl.org/dc/terms/" property="dct:rights">
47+
Copyright ©
48+
<span property="dct:dateCopyrighted">2020-2021</span>
49+
<span property="dct:publisher">PDS Interop</span>.
50+
Distributed under a
51+
<a rel="license" href="https://pdsinterop.org/license/">MIT license</a>.
52+
</p>
4653
gh_edit_link: true
4754
gh_edit_repository: https://github.com/pdsinterop/solid-nextcloud
4855
logo: https://avatars3.githubusercontent.com/u/65920341

build/.remarkrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"plugins": [
3+
"remark-preset-lint-recommended",
4+
["remark-lint-list-item-indent", "space"]
5+
]
6+
}

build/.yamllint

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
extends: default
3+
4+
ignore: |
5+
solid/vendor/
6+
7+
rules:
8+
brackets:
9+
max-spaces-inside: 1
10+
document-start: disable
11+
line-length:
12+
level: warning
13+
max: 120
14+
truthy: {allowed-values: ["true", "false", "on"]}

build/phpcs.xml.dist

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?xml version="1.0"?>
2+
<ruleset
3+
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
name="PDS Interop"
6+
>
7+
<description>PHP coding standards for PDS Interop projects</description>
8+
9+
<!-- Show sniff codes in all reports, and progress when running -->
10+
<arg value="sp"/>
11+
<!-- Strip the filepaths down to the relevant bit. -->
12+
<arg name="basepath" value="../solid/"/>
13+
<arg name="extensions" value="php"/>
14+
<arg name="colors"/>
15+
<!-- <arg name="parallel" value="75"/>-->
16+
17+
<file>.</file>
18+
<exclude-pattern>*/vendor/*|*/build/*</exclude-pattern>
19+
20+
<rule ref="PHPCompatibility"/>
21+
<config name="testVersion" value="7.3-"/>
22+
23+
<!-- Include the whole PSR-12 standard -->
24+
<rule ref="PSR12">
25+
<!-- Until things have been cleaned up a bit, these violations are allowed -->
26+
<exclude name="Generic.Files.LineLength.TooLong"/>
27+
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSame"/>
28+
<exclude name="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceAfterComma"/>
29+
<exclude name="Generic.WhiteSpace.DisallowTabIndent.NonIndentTabsUsed"/>
30+
<exclude name="Generic.WhiteSpace.DisallowTabIndent.TabsUsed"/>
31+
<exclude name="Generic.WhiteSpace.ScopeIndent.Incorrect"/>
32+
<exclude name="Generic.WhiteSpace.ScopeIndent.IncorrectExact"/>
33+
<exclude name="PSR12.Files.FileHeader.SpacingAfterBlock"/>
34+
<exclude name="PSR12.Files.FileHeader.SpacingInsideBlock"/>
35+
<exclude name="PSR12.Operators.OperatorSpacing.NoSpaceAfter"/>
36+
<exclude name="PSR12.Operators.OperatorSpacing.NoSpaceBefore"/>
37+
<exclude name="PSR2.Classes.ClassDeclaration.CloseBraceAfterBody"/>
38+
<exclude name="PSR2.Classes.ClassDeclaration.OpenBraceNewLine"/>
39+
<exclude name="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword"/>
40+
<exclude name="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpaceAfterEquals"/>
41+
<exclude name="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpaceBeforeEquals"/>
42+
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine"/>
43+
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.ContentAfterBrace"/>
44+
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.SpaceAfterFunction"/>
45+
<exclude name="Squiz.WhiteSpace.ScopeClosingBrace.Indent"/>
46+
<exclude name="Squiz.WhiteSpace.SuperfluousWhitespace.EndLine"/>
47+
</rule>
48+
49+
<!-- Have 12 chars padding maximum and always show as errors -->
50+
<rule ref="Generic.Formatting.MultipleStatementAlignment">
51+
<properties>
52+
<property name="maxPadding" value="12"/>
53+
<property name="error" value="true"/>
54+
</properties>
55+
</rule>
56+
<!-- Original PHP function should be used rather than an alias -->
57+
<rule ref="Generic.PHP.ForbiddenFunctions">
58+
<properties>
59+
<property name="forbiddenFunctions" type="array">
60+
<element key="chop" value="rtrim"/>
61+
<element key="doubleval" value="floatval"/>
62+
<element key="fputs" value="fwrite"/>
63+
<element key="ini_alter" value="ini_set"/>
64+
<element key="is_integer" value="is_int"/>
65+
<element key="is_real" value="is_float"/>
66+
<element key="is_writeable" value="is_writable"/>
67+
<element key="join" value="implode"/>
68+
<element key="key_exists" value="array_key_exists"/>
69+
<element key="pos" value="current"/>
70+
<element key="posix_errno" value="posix_get_last_error"/>
71+
<element key="recode" value="recode_string"/>
72+
<element key="session_commit" value="session_write_close"/>
73+
<element key="set_file_buffer" value="stream_set_write_buffer"/>
74+
<element key="show_source" value="highlight_file"/>
75+
<element key="sizeof" value="count"/>
76+
<element key="strchr" value="strstr"/>
77+
<element key="user_error" value="trigger_error"/>
78+
</property>
79+
</properties>
80+
</rule>
81+
</ruleset>

docker-compose.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
version: '3'
2-
3-
services:
4-
pubsub:
5-
build:
6-
context: https://github.com/pdsinterop/php-solid-pubsub-server.git#main
7-
ports:
8-
- 8080:8080
9-
expose:
10-
- 8080
11-
depends_on:
12-
- nextcloud
13-
nextcloud:
14-
build:
15-
context: ./
16-
dockerfile: Dockerfile
17-
expose:
18-
- 443
19-
ports:
20-
- 443:443
1+
version: '3'
2+
3+
services:
4+
pubsub:
5+
build:
6+
context: https://github.com/pdsinterop/php-solid-pubsub-server.git#main
7+
ports:
8+
- 8080:8080
9+
expose:
10+
- 8080
11+
depends_on:
12+
- nextcloud
13+
nextcloud:
14+
build:
15+
context: ./
16+
dockerfile: Dockerfile
17+
expose:
18+
- 443
19+
ports:
20+
- 443:443

solid/.travis.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,14 @@ before_script:
5050
- if [[ "$DB" == 'mysql' ]]; then mysql -u root -e "grant all on oc_autotest.* to 'oc_autotest'@'localhost';"; fi
5151
- cd nextcloud
5252
- mkdir data
53-
- ./occ maintenance:install --database-name oc_autotest --database-user oc_autotest --admin-user admin --admin-pass admin --database $DB --database-pass=''
53+
- |
54+
./occ maintenance:install \
55+
--admin-pass admin \
56+
--admin-user admin \
57+
--database $DB \
58+
--database-name oc_autotest \
59+
--database-pass='' \
60+
--database-user oc_autotest
5461
- ./occ app:enable solid
5562
- php -S localhost:8080 &
5663
- cd apps/solid
@@ -66,5 +73,5 @@ addons:
6673
mariadb: '10.1'
6774

6875
services:
69-
- postgresql
70-
- mariadb
76+
- postgresql
77+
- mariadb

0 commit comments

Comments
 (0)