Skip to content

Commit

Permalink
Setup GitHub CI (#1)
Browse files Browse the repository at this point in the history
* Enable Github CI

* Update ci.yml

* Require "colymba/gridfield-bulk-editing-tools" for now to fix "class not found" issue

* Fix CI tests

* Deacticate phplinting for now
  • Loading branch information
martinheise authored Jan 12, 2024
1 parent cf474ce commit da8c6a6
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 3 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: CI

on:
push:
pull_request:
workflow_dispatch:

jobs:
ci:
name: CI
uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1
with:
phplinting: false
14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
# Contributing

- Maintenance on this module is a shared effort of those who use it
- To contribute improvements to the code, ensure you raise a pull request and discuss with the module maintainers
- Please follow the Silverstripe CMS [code contribution guidelines](https://docs.silverstripe.org/en/contributing/code/) and [Module Standard](https://docs.silverstripe.org/en/developer_guides/extending/modules/#module-standard)
- Supply documentation that follows the [GitHub Flavored Markdown](https://help.github.com/articles/markdown-basics/) conventions
- When having discussions about this module in issues or pull request please adhere to the [Silverstripe CMS Community Code of Conduct](https://docs.silverstripe.org/en/project_governance/code_of_conduct/)

## Contributor license agreement

By supplying code to this module in patches, tickets and pull requests, you agree to assign copyright
of that code to Martin Heise, on the condition that these code changes are released under the
same BSD license as the original module. We ask for this so that the ownership in the license is clear
and unambiguous. By releasing this code under a permissive license such as BSD, this copyright assignment
won't prevent you from using the code in any way you see fit.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
],
"require": {
"php": "^8.0",
"silverstripe/framework": "^4.0 || ^5.0"
"silverstripe/framework": "^4.0 || ^5.0",
"colymba/gridfield-bulk-editing-tools": "^3.0 || ^4.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5"
},
"suggest": {
"bummzack/sortablefile": "Support for sortable UploadFields, e.g. for Download Package files",
"colymba/gridfield-bulk-editing-tools": "Support for bulk actions in Admin",
"ext/zip": "Support for DownloadPackages as zip"
},
"autoload": {
Expand Down
5 changes: 4 additions & 1 deletion phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="SilverStripe">
<ruleset name="Silverstripe">
<description>CodeSniffer ruleset for SilverStripe coding conventions.</description>

<file>src</file>
<file>tests</file>

<!-- base rules are PSR-12 -->
<rule ref="PSR12" >
<!-- Current exclusions -->
Expand Down
3 changes: 3 additions & 0 deletions tests/Model/DLPageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Mhe\DownloadCodes\Model\DLCode;
use Mhe\DownloadCodes\Model\DLRedemption;
use Page;
use PHPUnit\Util\Test;
use SilverStripe\Assets\Dev\TestAssetStore;
use SilverStripe\Assets\File;
use SilverStripe\Assets\Folder;
Expand Down Expand Up @@ -40,6 +41,8 @@ protected function setUp(): void

// setup test file storage
TestAssetStore::activate('DownloadFiles');
// test response code like in live mode
TestAssetStore::config()->set('denied_response_code', 404);
/** @var File $file */
$files = File::get()->exclude('ClassName', Folder::class);
foreach ($files as $file) {
Expand Down

0 comments on commit da8c6a6

Please sign in to comment.