From 3cf6d5add03f9d2aa60d29e8befed8819df7995d Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 6 Jan 2019 17:45:09 +0900 Subject: [PATCH 01/21] =?UTF-8?q?PluginsRole=E3=81=AE=E3=82=AF=E3=82=A8?= =?UTF-8?q?=E3=83=AA=E7=B5=90=E6=9E=9C=E3=82=92=E3=82=AD=E3=83=A3=E3=83=83?= =?UTF-8?q?=E3=82=B7=E3=83=A5=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=81=97=E3=81=9F=E3=81=93=E3=81=A8=E3=81=AB?= =?UTF-8?q?=E3=82=88=E3=82=8B=E6=94=B9=E4=BF=AE=20https://github.com/NetCo?= =?UTF-8?q?mmons3/NetCommons3/issues/1337?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/Behavior/UserAttributeBehavior.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Model/Behavior/UserAttributeBehavior.php b/Model/Behavior/UserAttributeBehavior.php index 41473ae..c313219 100644 --- a/Model/Behavior/UserAttributeBehavior.php +++ b/Model/Behavior/UserAttributeBehavior.php @@ -64,7 +64,7 @@ public function saveDefaultUserAttributeRoles(Model $model, $data) { 'PluginsRole' => 'PluginManager.PluginsRole', ]); - $pluginsRoles = $model->PluginsRole->find('all', array( + $pluginsRoles = $model->PluginsRole->cacheFindQuery('all', array( 'recursive' => -1, 'fields' => [ 'id', 'role_key', 'plugin_key' From 6adcecda05ca99ab0afd807d54d11821f4d856df Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Thu, 9 May 2019 11:22:50 +0900 Subject: [PATCH 02/21] =?UTF-8?q?change:=20beforeValidate()=E3=82=92?= =?UTF-8?q?=E5=91=BC=E3=81=B3=E5=87=BA=E3=81=99=E3=81=9F=E3=81=B3=E3=81=AB?= =?UTF-8?q?Hash::merge=E3=81=A7=E3=83=90=E3=83=AA=E3=83=87=E3=83=BC?= =?UTF-8?q?=E3=82=B7=E3=83=A7=E3=83=B3=E3=83=AB=E3=83=BC=E3=83=AB=E3=81=8C?= =?UTF-8?q?=E5=A2=97=E3=81=88=E3=82=8B=E3=81=93=E3=81=A8=E3=81=8C=E3=81=82?= =?UTF-8?q?=E3=82=8B=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3=E3=80=82ValidateM?= =?UTF-8?q?erge::merge=E3=81=B8=E7=BD=AE=E3=81=8D=E6=8F=9B=E3=81=88?= =?UTF-8?q?=E3=81=9F=20Refs=20https://github.com/NetCommons3/NetCommons3/i?= =?UTF-8?q?ssues/1486?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/UserAttribute.php | 2 +- Model/UserAttributeChoice.php | 2 +- Model/UserAttributeLayout.php | 2 +- Model/UserAttributeSetting.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Model/UserAttribute.php b/Model/UserAttribute.php index b97eaa6..18700af 100644 --- a/Model/UserAttribute.php +++ b/Model/UserAttribute.php @@ -175,7 +175,7 @@ class UserAttribute extends UserAttributesAppModel { * @see Model::save() */ public function beforeValidate($options = array()) { - $this->validate = Hash::merge($this->validate, array( + $this->validate = ValidateMerge::merge($this->validate, array( 'language_id' => array( 'numeric' => array( 'rule' => array('numeric'), diff --git a/Model/UserAttributeChoice.php b/Model/UserAttributeChoice.php index c21b8fd..501d1ac 100644 --- a/Model/UserAttributeChoice.php +++ b/Model/UserAttributeChoice.php @@ -108,7 +108,7 @@ class UserAttributeChoice extends UsersAppModel { * @see Model::save() */ public function beforeValidate($options = array()) { - $this->validate = Hash::merge($this->validate, array( + $this->validate = ValidateMerge::merge($this->validate, array( 'language_id' => array( 'numeric' => array( 'rule' => array('numeric'), diff --git a/Model/UserAttributeLayout.php b/Model/UserAttributeLayout.php index 05ad482..7fb2c4b 100644 --- a/Model/UserAttributeLayout.php +++ b/Model/UserAttributeLayout.php @@ -41,7 +41,7 @@ class UserAttributeLayout extends UserAttributesAppModel { * @see Model::save() */ public function beforeValidate($options = array()) { - $this->validate = Hash::merge($this->validate, array( + $this->validate = ValidateMerge::merge($this->validate, array( 'col' => array( 'numeric' => array( 'rule' => array('numeric'), diff --git a/Model/UserAttributeSetting.php b/Model/UserAttributeSetting.php index afa1ebf..aa73c60 100644 --- a/Model/UserAttributeSetting.php +++ b/Model/UserAttributeSetting.php @@ -60,7 +60,7 @@ class UserAttributeSetting extends UserAttributesAppModel { * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ public function beforeValidate($options = array()) { - $this->validate = Hash::merge($this->validate, array( + $this->validate = ValidateMerge::merge($this->validate, array( 'user_attribute_key' => array( 'notBlank' => array( 'rule' => array('notBlank'), From 9fb4ab5e144697afdcd8d3458d573e3682e0b783 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 23 Sep 2019 22:10:36 +0900 Subject: [PATCH 03/21] =?UTF-8?q?fix:=20test:=20UnitTest=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=20https://github.com/NetCommons3/NetCommons3/issues/1468?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BeforeRenderTest.php | 70 ------------------- 1 file changed, 70 deletions(-) delete mode 100644 Test/Case/View/Helper/UserAttributeLayoutHelper/BeforeRenderTest.php diff --git a/Test/Case/View/Helper/UserAttributeLayoutHelper/BeforeRenderTest.php b/Test/Case/View/Helper/UserAttributeLayoutHelper/BeforeRenderTest.php deleted file mode 100644 index ce2c166..0000000 --- a/Test/Case/View/Helper/UserAttributeLayoutHelper/BeforeRenderTest.php +++ /dev/null @@ -1,70 +0,0 @@ - - * @author Shohei Nakajima - * @link http://www.netcommons.org NetCommons Project - * @license http://www.netcommons.org/license.txt NetCommons License - * @copyright Copyright 2014, NetCommons Project - */ - -App::uses('NetCommonsControllerTestCase', 'NetCommons.TestSuite'); - -/** - * UserAttributeLayoutHelper::beforeRender()のテスト - * - * @author Shohei Nakajima - * @package NetCommons\UserAttributes\Test\Case\Controller\Component\UserAttributeLayoutHelper - */ -class UserAttributeLayoutHelperBeforeRenderTest extends NetCommonsControllerTestCase { - -/** - * Fixtures - * - * @var array - */ - public $fixtures = array(); - -/** - * Plugin name - * - * @var string - */ - public $plugin = 'user_attributes'; - -/** - * setUp method - * - * @return void - */ - public function setUp() { - parent::setUp(); - - //テストプラグインのロード - NetCommonsCakeTestCase::loadTestPlugin($this, 'UserAttributes', 'TestUserAttributes'); - } - -/** - * beforeRender()のテスト - * - * @return void - */ - public function testBeforeRender() { - //テストコントローラ生成 - $this->generateNc('TestUserAttributes.TestUserAttributeLayoutHelperBeforeRender'); - - //テスト実行 - $this->_testGetAction('/test_user_attributes/test_user_attribute_layout_helper_before_render/index', - array('method' => 'assertNotEmpty'), null, 'view'); - - //チェック - $pattern = '/' . preg_quote('View/Helper/TestUserAttributeLayoutHelperBeforeRender', '/') . '/'; - $this->assertRegExp($pattern, $this->view); - - //cssのURLチェック - $pattern = '//'; - $this->assertRegExp($pattern, $this->contents); - } - -} From 53068596381add453b965bb14a1ada36c2e510c3 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 23 Sep 2019 22:11:22 +0900 Subject: [PATCH 04/21] =?UTF-8?q?fix:=20test:=20travis-ci=E3=81=AEphp7.2?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=20https://github.com/NetCommons3/NetCommons3?= =?UTF-8?q?/issues/1451?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 4 +++- phpunit.xml.dist | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 62c8424..5749527 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,8 +6,10 @@ php: - 5.6 - 7.0 - 7.1 + - 7.2 -sudo: required +sudo: false +dist: trusty env: matrix: diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 9b4caff..b93bde0 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -14,6 +14,5 @@ - From 21ffba9a8dcc420778d1041ba3da95fe83cc7781 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 14 Mar 2020 15:28:35 +0900 Subject: [PATCH 05/21] =?UTF-8?q?change:=20test:=20travis.yml=E3=81=8B?= =?UTF-8?q?=E3=82=89php5.4,5.5=E3=82=92=E5=89=8A=E9=99=A4=E3=80=82php7.3,7?= =?UTF-8?q?.4=E3=82=92=E8=BF=BD=E5=8A=A0=20https://github.com/NetCommons3/?= =?UTF-8?q?NetCommons3/issues/1560?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5749527..5c6d749 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,12 @@ language: php php: - - 5.4 - - 5.5 - 5.6 - 7.0 - 7.1 - 7.2 + - 7.3 + - 7.4 sudo: false dist: trusty From 7b215cdd94656267ca690a8d0298756738f87574 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 14 Mar 2020 17:45:32 +0900 Subject: [PATCH 06/21] =?UTF-8?q?change:=20test:=20php7.4=E3=81=A7Notice?= =?UTF-8?q?=E3=81=8C=E7=99=BA=E7=94=9F=E3=81=99=E3=82=8B=E3=81=9F=E3=82=81?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20=E2=80=BBPHP7.4=E3=81=8B=E3=82=89=E3=82=B9?= =?UTF-8?q?=E3=82=AB=E3=83=A9=E3=83=BC=E5=9E=8B=E5=A4=89=E6=95=B0=E3=81=AB?= =?UTF-8?q?=E9=85=8D=E5=88=97=E3=82=A2=E3=82=AF=E3=82=BB=E3=82=B9=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=81=A8E=5FNOTICE=E3=81=8C=E5=87=BA=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AA=E3=81=A3=E3=81=9F=E3=80=82=20https:?= =?UTF-8?q?//github.com/NetCommons3/NetCommons3/issues/1560?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UserAttributeChoice/SaveUserAttributeChoicesTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Test/Case/Model/UserAttributeChoice/SaveUserAttributeChoicesTest.php b/Test/Case/Model/UserAttributeChoice/SaveUserAttributeChoicesTest.php index 78039fd..922d6d7 100644 --- a/Test/Case/Model/UserAttributeChoice/SaveUserAttributeChoicesTest.php +++ b/Test/Case/Model/UserAttributeChoice/SaveUserAttributeChoicesTest.php @@ -334,7 +334,9 @@ public function testSkipDataType($dataType, $count) { $method = $this->_methodName; //Mockの生成 - $this->_mockForReturn($model, 'UserAttributes.UserAttributeChoice', 'save', true, $count); + $this->_mockForReturn($model, 'UserAttributes.UserAttributeChoice', 'save', [ + 'UserAttributeChoice' => ['key' => $dataType . '_choice'] + ], $count); //テストデータ $data = $this->__data('default', $dataType); From be31473b2a41ece08493caf133e8827e5d42958a Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 8 Aug 2020 16:28:07 +0900 Subject: [PATCH 07/21] =?UTF-8?q?change:=20test:=20Travis=E3=81=8B?= =?UTF-8?q?=E3=82=89PHP5.6=E3=82=92=E5=89=8A=E9=99=A4,php72=E4=BB=A5?= =?UTF-8?q?=E9=99=8D=E3=81=A7UnitTest=E3=81=A7Warning=E3=81=8C=E5=87=BA?= =?UTF-8?q?=E3=82=8B=E3=81=9F=E3=82=81=E4=BF=AE=E6=AD=A3=20https://github.?= =?UTF-8?q?com/NetCommons3/NetCommons3/issues/1588?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 1 - phpunit.xml.dist | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5c6d749..0302d8d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: php php: - - 5.6 - 7.0 - 7.1 - 7.2 diff --git a/phpunit.xml.dist b/phpunit.xml.dist index b93bde0..4ad5c2a 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,11 @@ + + + + + + app/Plugin/UserAttributes From e6ed8c527a394a3ba2dbc5ea8479f1183b08b002 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Wed, 26 Aug 2020 20:22:54 +0900 Subject: [PATCH 08/21] change: Version number to 3.3.2 --- VERSION.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 VERSION.txt diff --git a/VERSION.txt b/VERSION.txt new file mode 100644 index 0000000..4772543 --- /dev/null +++ b/VERSION.txt @@ -0,0 +1 @@ +3.3.2 From 21c14cb23cd6706e82551ba9ddea9061771b6a88 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 13 Dec 2020 20:23:01 +0900 Subject: [PATCH 09/21] =?UTF-8?q?fix:=20test:=20TravisCI=E3=81=AEphp7.3?= =?UTF-8?q?=E3=81=A7=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=8C=E5=87=BA=E3=82=8B?= =?UTF-8?q?=E3=81=9F=E3=82=81=E4=BF=AE=E6=AD=A3=20https://github.com/NetCo?= =?UTF-8?q?mmons3/NetCommons3/issues/1618?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0302d8d..4c29341 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ php: - 7.0 - 7.1 - 7.2 - - 7.3 + - 7.3.24 - 7.4 sudo: false From 821ad5da4427de8d1c1f95d38cb4d30867e24f39 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 23 Jan 2021 14:08:04 +0900 Subject: [PATCH 10/21] =?UTF-8?q?add:=20release=E3=82=BF=E3=82=B0=E4=BB=98?= =?UTF-8?q?=E3=81=91=E3=81=AEgithub=20action=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/NetCommons3/NetCommons3/issues/1619 --- .github/workflows/release.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a3225bc --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - '3*' + +name: Create Release + +jobs: + build: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + body: | + NetCommons ${{ github.ref }} released. + draft: false + prerelease: false From 5b679941cf86cc5d29760c44353ae40f569f3d39 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 23 Jan 2021 14:08:09 +0900 Subject: [PATCH 11/21] change: Version number to 3.3.3 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 4772543..619b537 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.2 +3.3.3 From a8975faf512098a4f9d6b07147cf92990f7113a5 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 2 Aug 2021 22:09:40 +0900 Subject: [PATCH 12/21] =?UTF-8?q?fix:=20callbacks=E3=82=92=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E3=81=97=E3=81=A6=E3=80=81actAs=E3=81=8C=E5=8B=95?= =?UTF-8?q?=E3=81=8B=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20https://github.com/NetCommons3/NetCommons3/issues/1?= =?UTF-8?q?562?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/UserAttributeLayout.php | 2 +- Model/UserAttributeSetting.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Model/UserAttributeLayout.php b/Model/UserAttributeLayout.php index 7fb2c4b..5e9760e 100644 --- a/Model/UserAttributeLayout.php +++ b/Model/UserAttributeLayout.php @@ -79,7 +79,7 @@ public function updateUserAttributeLayout($data, $fieldName) { try { //UserAttributeLayoutテーブルの登録 - if (! $this->saveField($fieldName, $data[$this->alias][$fieldName], false)) { + if (! $this->saveField($fieldName, $data[$this->alias][$fieldName], ['callbacks' => false])) { throw new InternalErrorException(__d('net_commons', 'Internal Server Error')); } diff --git a/Model/UserAttributeSetting.php b/Model/UserAttributeSetting.php index aa73c60..276cac1 100644 --- a/Model/UserAttributeSetting.php +++ b/Model/UserAttributeSetting.php @@ -274,7 +274,7 @@ public function updateDisplay($data, $fieldName) { try { //UserAttributeSettingテーブルの登録 - if (! $this->saveField($fieldName, $data[$this->alias][$fieldName], false)) { + if (! $this->saveField($fieldName, $data[$this->alias][$fieldName], ['callbacks' => false])) { throw new InternalErrorException(__d('net_commons', 'Internal Server Error')); } From 79aa113217c7857f979533959cda1c8bc93de6e1 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 2 Aug 2021 22:10:03 +0900 Subject: [PATCH 13/21] =?UTF-8?q?change:=20test:=20TravisCI=E3=81=8B?= =?UTF-8?q?=E3=82=89GithubAction=E3=81=AB=E5=A4=89=E6=9B=B4=20https://gith?= =?UTF-8?q?ub.com/NetCommons3/NetCommons3/issues/1650?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 137 ++++++++++++++++++++++++++++++++++++ .travis.yml | 42 ----------- README.md | 11 +-- phpunit.xml.dist | 4 +- 4 files changed, 141 insertions(+), 53 deletions(-) create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..d6bd01e --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,137 @@ +on: + push: + branches: + - main + - master + - availability + pull_request: + branches: + - main + - master + - availability + +name: tests + +jobs: + tests: + name: tests + runs-on: ubuntu-18.04 + strategy: + matrix: + php: [ '7.1', '7.2', '7.3', '7.4' ] + + env: + NC3_BUILD_DIR: "/opt/nc3" + NC3_DOCKER_DIR: "/opt/docker" + NC3_GIT_URL: "git://github.com/NetCommons3/NetCommons3.git" + NC3_GIT_BRANCH: "master" + PLUGIN_BUILD_DIR: ${{ github.workspace }} + PHP_VERSION: ${{ matrix.php }} + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: cakephp_test + + steps: + - uses: actions/checkout@v2 + + - name: environment + run: | + echo "GITHUB_WORKSPACE=${GITHUB_WORKSPACE}" + echo "PLUGIN_BUILD_DIR=${PLUGIN_BUILD_DIR}" + echo "PHP_VERSION=${PHP_VERSION}" + ls -al ${PLUGIN_BUILD_DIR} + + - name: docker-compose install + run: | + curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose + chmod +x ~/docker-compose + sudo mv ~/docker-compose /usr/local/bin/docker-compose + docker-compose --version + + - name: git clone nc3 + run: git clone -b ${NC3_GIT_BRANCH} ${NC3_GIT_URL} ${NC3_BUILD_DIR} + + - name: git clone nc3_docker + run: git clone https://github.com/NetCommons3/nc3app-docker.git ${NC3_DOCKER_DIR} + + - name: docker-compose start + run: | + cd ${NC3_DOCKER_DIR} + docker-compose up -d + docker-compose start + + - run: docker ps + + - name: check libraries + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/start-on-docker.sh + + - name: nc3 build + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/app-build.sh + + - name: phpcs (PHP CodeSniffer) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpcs.sh + + - name: phpmd (PHP Mess Detector) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpmd.sh + + - name: phpcpd (PHP Copy/Paste Detector) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpcpd.sh + + - name: gjslint (JavaScript Style Check) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/gjslint.sh + + - name: phpdoc (PHP Documentor) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpdoc.sh + + - name: phpunit (PHP UnitTest) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpunit.sh + sudo -s chmod a+w -R ${NC3_BUILD_DIR}/build + + - name: push coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_FLAG_NAME: ${{ matrix.php }} + run: | + cd ${NC3_BUILD_DIR} + ls -la ${NC3_BUILD_DIR} + vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v + + - name: docker-compose remove + run: | + cd ${NC3_DOCKER_DIR} + docker-compose rm -f + + # テスト成功時はこちらのステップが実行される + - name: Slack Notification on Success + if: success() + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_CHANNEL: notify-netcommons3 + SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" + SLACK_COLOR: good + + # テスト失敗時はこちらのステップが実行される + - name: Slack Notification on Failure + uses: rtCamp/action-slack-notify@v2.2.0 + if: failure() + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_CHANNEL: notify-netcommons3 + SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" + SLACK_COLOR: danger diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4c29341..0000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -language: php - -php: - - 7.0 - - 7.1 - - 7.2 - - 7.3.24 - - 7.4 - -sudo: false -dist: trusty - -env: - matrix: - - NETCOMMONS_VERSION=master DB=mysql - global: - - secure: "SmIg7RRMzmInqAsvXdypo4YmL/DMQzT3x5quxcmxqiMlwIyzNA+ETag4hi9/+U6Nmajo7rjEJ6uqUELpmuR6grNZQNTU1fMT59Ay3GGatPc/sHu4yTkwORw8rtsQeCdNAx1IyL4oHGoGA7jjC0IMMMr100VT9iBk+XfpMxWPM7MXx6sJ3nItnmLkjnupQCw+/6QvHHMAe5MdU2L8a9rn2m5q70JoWIE2OR1K8ZapBZzfOdzUw/3S0YXrElJ9ovLzBk+ZvfozKK2Ewn13T8CCL3yQTfL9lnnlBrFZhJeCAzOF0ewfgQ0ERR8U916nchwT3G6dewQhHFXvWTbgMdTJWPYU438by0JS1SIJGkPtzY17lPf9k7tCfoCVp7tO0DgcbclAhnlKLzXG7Oz2L3ri0DEhqVWjO8KKZ3gcr2lI86xdbdPMlcr9cngKsorsn1o45/dqjmTQjisaN7VxH8GsFF0KQgEX9WbwnEx9dV86XY/C1iedCHbXi5OgK8cqr0Xs2TWdxzMDxmre5LLwS3QN4JrMWjM9PkUa4I9UN5VW+BtWkoQv9kiAqlKg6y7DWrP1VAO8U+WZuugpPYJ5BB+//huiij/k7NgtMwPw+1yqkUNLl1LLUrYSE1gPrKZ2X3cYemMvZPaT+Fx4SyGupRbDFVilTTrE/NO8YawBAdG+PcY=" - - GIT_COMMITTER_NAME=s-nakajima - - GIT_COMMITTER_EMAIL=nakajimashouhei@gmail.com - - GIT_AUTHOR_NAME=s-nakajima - - GIT_AUTHOR_EMAIL=nakajimashouhei@gmail.com - -before_script: - - export NETCOMMONS_BUILD_DIR=`dirname $TRAVIS_BUILD_DIR`/NetCommons3 - - git clone git://github.com/NetCommons3/NetCommons3 $NETCOMMONS_BUILD_DIR - - cd $NETCOMMONS_BUILD_DIR - - git checkout $NETCOMMONS_VERSION - - travis_wait . tools/build/plugins/cakephp/travis/pre.sh - - . tools/build/plugins/cakephp/travis/environment.sh - -script: - - . tools/build/plugins/cakephp/travis/main.sh - -after_script: - - . tools/build/plugins/cakephp/travis/post.sh - -notifications: - email: - recipients: - - netcommons3@googlegroups.com - on_success: never # default: change - on_failure: always # default: always diff --git a/README.md b/README.md index 520e9bf..fab88ef 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,6 @@ UserAttributes ============== -UserAttributes for NetComomns3 - -[![Build Status](https://api.travis-ci.org/NetCommons3/UserAttributes.png?branch=master)](https://travis-ci.org/NetCommons3/UserAttributes) -[![Coverage Status](https://coveralls.io/repos/NetCommons3/UserAttributes/badge.png?branch=master)](https://coveralls.io/r/NetCommons3/UserAttributes?branch=master) - -| dependencies | status | -| ------------- | ------ | -| composer.json | [![Dependency Status](https://www.versioneye.com/user/projects/55cbc0a1b7d70b000f000250/badge.png)](https://www.versioneye.com/user/projects/55cbc0a1b7d70b000f000250) | +[![Tests Status](https://github.com/NetCommons3/UserAttributes/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/NetCommons3/UserAttributes/actions/workflows/tests.yml) +[![Coverage Status](https://coveralls.io/repos/NetCommons3/UserAttributes/badge.svg?branch=master)](https://coveralls.io/r/NetCommons3/UserAttributes?branch=master) +[![Stable Version](https://img.shields.io/packagist/v/netcommons/user-attributes.svg?label=stable)](https://packagist.org/packages/netcommons/user-attributes) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 4ad5c2a..4bd31aa 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -3,9 +3,6 @@ - - - app/Plugin/UserAttributes @@ -20,5 +17,6 @@ + From 5623486c3d9f26a11481659a6f7f7251fc8d8893 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Wed, 11 Aug 2021 15:20:03 +0900 Subject: [PATCH 14/21] =?UTF-8?q?change:=20test:=20Slack=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3,=20mysql8.0=E3=83=86=E3=82=B9=E3=83=88?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20https://github.com/NetCommons3/NetCommons3?= =?UTF-8?q?/issues/1650?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 35 ++++++++++++++++++++++++-- .github/workflows/tests.yml | 47 +++++++++++++++++++++++++---------- 2 files changed, 67 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a3225bc..592d72f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,16 +4,25 @@ on: tags: - '3*' -name: Create Release +name: create_release jobs: build: - name: Create Release + name: create_release runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 + - name: Slack Notification on Start + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_RELEASE }} + SLACK_CHANNEL: notify-nc3-release + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: "#f0ad4e" + SLACK_MESSAGE: "Start Job" + - name: Create Release id: create_release uses: actions/create-release@v1 @@ -26,3 +35,25 @@ jobs: NetCommons ${{ github.ref }} released. draft: false prerelease: false + + # テスト成功時はこちらのステップが実行される + - name: Slack Notification on Finish + uses: rtCamp/action-slack-notify@v2.2.0 + if: success() + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_RELEASE }} + SLACK_CHANNEL: notify-nc3-release + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: good + SLACK_MESSAGE: "Job Success" + + # テスト失敗時はこちらのステップが実行される + - name: Slack Notification on Failure + uses: rtCamp/action-slack-notify@v2.2.0 + if: failure() + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_RELEASE }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: danger + SLACK_MESSAGE: "Job Failure" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d6bd01e..1477ea2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,12 +13,26 @@ on: name: tests jobs: + setup: + name: setup + runs-on: ubuntu-18.04 + steps: + - name: Slack Notification on Start + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: "#f0ad4e" + tests: name: tests + needs: setup runs-on: ubuntu-18.04 strategy: matrix: php: [ '7.1', '7.2', '7.3', '7.4' ] + mysql: [ '5.7', '8.0' ] env: NC3_BUILD_DIR: "/opt/nc3" @@ -27,6 +41,7 @@ jobs: NC3_GIT_BRANCH: "master" PLUGIN_BUILD_DIR: ${{ github.workspace }} PHP_VERSION: ${{ matrix.php }} + MYSQL_VERSION: ${{ matrix.mysql }} MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: cakephp_test @@ -38,6 +53,7 @@ jobs: echo "GITHUB_WORKSPACE=${GITHUB_WORKSPACE}" echo "PLUGIN_BUILD_DIR=${PLUGIN_BUILD_DIR}" echo "PHP_VERSION=${PHP_VERSION}" + echo "MYSQL_VERSION=${MYSQL_VERSION}" ls -al ${PLUGIN_BUILD_DIR} - name: docker-compose install @@ -116,22 +132,27 @@ jobs: cd ${NC3_DOCKER_DIR} docker-compose rm -f - # テスト成功時はこちらのステップが実行される - - name: Slack Notification on Success - if: success() - uses: rtCamp/action-slack-notify@v2.2.0 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_CHANNEL: notify-netcommons3 - SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" - SLACK_COLOR: good - # テスト失敗時はこちらのステップが実行される - name: Slack Notification on Failure uses: rtCamp/action-slack-notify@v2.2.0 if: failure() env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_CHANNEL: notify-netcommons3 - SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}(php${{ matrix.php }}, mysql${{ matrix.mysql }})" SLACK_COLOR: danger + + teardown: + name: teardown + runs-on: ubuntu-18.04 + needs: tests + steps: + # テスト成功時はこちらのステップが実行される + - name: Slack Notification on Success + if: success() + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: good From ecbafaf1f022c73121ebfb815bf0e8e128a38095 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 13 Aug 2021 18:57:00 +0900 Subject: [PATCH 15/21] change: Version number to 3.3.4 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 619b537..a0891f5 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.3 +3.3.4 From a288ae2031692287589da925c34102571c067ad7 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 11 Feb 2022 22:50:51 +0900 Subject: [PATCH 16/21] change: Version number to 3.3.5 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index a0891f5..fa7adc7 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.4 +3.3.5 From 2ce17c8879dfff7eb2f878fc1584732ca69e96a3 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 7 Mar 2022 23:05:50 +0900 Subject: [PATCH 17/21] =?UTF-8?q?fix:=20=E4=BC=9A=E5=93=A1=E9=A0=85?= =?UTF-8?q?=E7=9B=AE=E9=81=B8=E6=8A=9E=E8=82=A2=E3=81=A7=E3=83=90=E3=83=AA?= =?UTF-8?q?=E3=83=87=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E3=81=8C=E5=87=BA=E3=81=A6=E3=82=82I18n=E3=81=8C?= =?UTF-8?q?=E5=A4=89=E6=8F=9B=E3=81=95=E3=82=8C=E3=81=9A=E3=81=AB=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E3=81=95=E3=82=8C=E3=82=8B=E3=80=82=EF=BC=88NC3?= =?UTF-8?q?=E3=81=AE=E3=81=BF=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Locale/jpn/LC_MESSAGES/user_attributes.po | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Locale/jpn/LC_MESSAGES/user_attributes.po b/Locale/jpn/LC_MESSAGES/user_attributes.po index fbe9b0e..a94ddaf 100644 --- a/Locale/jpn/LC_MESSAGES/user_attributes.po +++ b/Locale/jpn/LC_MESSAGES/user_attributes.po @@ -18,6 +18,11 @@ msgstr "" msgid "Item name" msgstr "項目名" +#: UserAttributes/Model/UserAttributeChoice.php:131 +#: UserAttributes/Test/Case/Model/UserAttributeChoice/ValidateTest.php:81;83 +msgid "Item choice name" +msgstr "選択肢名" + #: UserAttributes/View/Elements/UserAttributes/delete_form.ctp:25;35 msgid "User attribute" msgstr "会員項目" From f1ab64a2f09cfcdb8e0887f8e29063ce4874b161 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 24 Feb 2023 17:14:18 +0900 Subject: [PATCH 18/21] =?UTF-8?q?test:=20Github=20Action=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1477ea2..7cfa881 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -44,10 +44,14 @@ jobs: MYSQL_VERSION: ${{ matrix.mysql }} MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: cakephp_test + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 + - name: Fix up git URLs + run: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig + - name: environment run: | echo "GITHUB_WORKSPACE=${GITHUB_WORKSPACE}" @@ -58,7 +62,7 @@ jobs: - name: docker-compose install run: | - curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose + curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose chmod +x ~/docker-compose sudo mv ~/docker-compose /usr/local/bin/docker-compose docker-compose --version From 924dca655562e52a2f85337c50f03227f69d2b55 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 26 Feb 2023 07:38:36 +0900 Subject: [PATCH 19/21] change: Version number to 3.3.6 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index fa7adc7..9c25013 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.5 +3.3.6 From 5ede9e00265d559ffec93ebf361c23be9ba30be8 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 6 Oct 2023 10:03:44 +0900 Subject: [PATCH 20/21] =?UTF-8?q?test:=20github=20action=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7cfa881..6da4321 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,22 +3,21 @@ on: branches: - main - master - - availability pull_request: branches: - main - master - - availability name: tests jobs: setup: name: setup - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - name: Slack Notification on Start uses: rtCamp/action-slack-notify@v2.2.0 + if: env.SLACK_WEBHOOK != '' env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} SLACK_CHANNEL: notify-nc3-tests @@ -28,7 +27,7 @@ jobs: tests: name: tests needs: setup - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest strategy: matrix: php: [ '7.1', '7.2', '7.3', '7.4' ] @@ -92,46 +91,53 @@ jobs: docker-compose exec -T nc3app bash /opt/scripts/app-build.sh - name: phpcs (PHP CodeSniffer) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpcs.sh - name: phpmd (PHP Mess Detector) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpmd.sh - name: phpcpd (PHP Copy/Paste Detector) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpcpd.sh - name: gjslint (JavaScript Style Check) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/gjslint.sh - name: phpdoc (PHP Documentor) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpdoc.sh - name: phpunit (PHP UnitTest) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpunit.sh sudo -s chmod a+w -R ${NC3_BUILD_DIR}/build - - name: push coveralls - env: - COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_FLAG_NAME: ${{ matrix.php }} - run: | - cd ${NC3_BUILD_DIR} - ls -la ${NC3_BUILD_DIR} - vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v +# - name: push coveralls +# env: +# COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# COVERALLS_FLAG_NAME: ${{ matrix.php }} +# run: | +# cd ${NC3_BUILD_DIR} +# ls -la ${NC3_BUILD_DIR} +# vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v - name: docker-compose remove + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose rm -f @@ -139,7 +145,7 @@ jobs: # テスト失敗時はこちらのステップが実行される - name: Slack Notification on Failure uses: rtCamp/action-slack-notify@v2.2.0 - if: failure() + if: env.SLACK_WEBHOOK != '' && failure() env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} SLACK_CHANNEL: notify-nc3-tests @@ -148,13 +154,13 @@ jobs: teardown: name: teardown - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest needs: tests steps: # テスト成功時はこちらのステップが実行される - name: Slack Notification on Success - if: success() uses: rtCamp/action-slack-notify@v2.2.0 + if: env.SLACK_WEBHOOK != '' && success() env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} SLACK_CHANNEL: notify-nc3-tests From 8403f5d3b783ccf8d3a5c97ada611ee0d8241c15 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 10 Oct 2023 00:35:47 +0900 Subject: [PATCH 21/21] change: Version number to 3.3.7 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 9c25013..86fb650 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.6 +3.3.7