diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1477ea2..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' ] @@ -44,10 +43,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 +61,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 @@ -88,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 @@ -135,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 @@ -144,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 diff --git a/Test/Case/Model/MenuFrameSetting/GetMenuFrameSettingTest.php b/Test/Case/Model/MenuFrameSetting/GetMenuFrameSettingTest.php index 12c3e7c..344b248 100644 --- a/Test/Case/Model/MenuFrameSetting/GetMenuFrameSettingTest.php +++ b/Test/Case/Model/MenuFrameSetting/GetMenuFrameSettingTest.php @@ -66,6 +66,7 @@ public function dataProvider() { 'id' => '2', 'frame_key' => 'frame_2', 'display_type' => 'major', + 'is_private_room_hidden' => null, 'created_user' => null, 'created' => null, 'modified_user' => null, @@ -74,6 +75,7 @@ public function dataProvider() { array('frameKey' => 'frame_8', 'expected' => array( 'frame_key' => 'frame_8', 'display_type' => 'major', + 'is_private_room_hidden' => null, 'created_user' => null, 'created' => null, 'modified_user' => null, diff --git a/Test/Case/Model/MenuFrameSetting/SaveMenuFrameSettingTest.php b/Test/Case/Model/MenuFrameSetting/SaveMenuFrameSettingTest.php index f45155d..ca34f35 100644 --- a/Test/Case/Model/MenuFrameSetting/SaveMenuFrameSettingTest.php +++ b/Test/Case/Model/MenuFrameSetting/SaveMenuFrameSettingTest.php @@ -63,6 +63,7 @@ private function __data() { 'id' => '3', 'frame_key' => 'frame_3', 'display_type' => 'major', + 'is_private_room_hidden' => null, ), ); diff --git a/Test/Case/Model/MenuFrameSetting/SaveTest.php b/Test/Case/Model/MenuFrameSetting/SaveTest.php index 59f2aab..c93246c 100644 --- a/Test/Case/Model/MenuFrameSetting/SaveTest.php +++ b/Test/Case/Model/MenuFrameSetting/SaveTest.php @@ -63,6 +63,7 @@ private function __data() { 'id' => '3', 'frame_key' => 'frame_3', 'display_type' => 'major', + 'is_private_room_hidden' => null, ), 'Menus' => array( 1 => array( diff --git a/Test/Fixture/MenuFrameSettingFixture.php b/Test/Fixture/MenuFrameSettingFixture.php index 6f13ec5..e09e084 100644 --- a/Test/Fixture/MenuFrameSettingFixture.php +++ b/Test/Fixture/MenuFrameSettingFixture.php @@ -17,25 +17,6 @@ */ class MenuFrameSettingFixture extends CakeTestFixture { -/** - * Fields - * - * @var array - */ - public $fields = array( - 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary', 'comment' => 'ID'), - 'frame_key' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'comment' => 'フレームKey', 'charset' => 'utf8'), - 'display_type' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'comment' => 'bootstrap navi type', 'charset' => 'utf8'), - 'created_user' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false, 'comment' => '作成者'), - 'created' => array('type' => 'datetime', 'null' => true, 'default' => null, 'comment' => '作成日時'), - 'modified_user' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false, 'comment' => '更新者'), - 'modified' => array('type' => 'datetime', 'null' => true, 'default' => null, 'comment' => '更新日時'), - 'indexes' => array( - 'PRIMARY' => array('column' => 'id', 'unique' => 1) - ), - 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB') - ); - /** * Records * @@ -46,27 +27,42 @@ class MenuFrameSettingFixture extends CakeTestFixture { 'id' => '1', 'frame_key' => 'frame_1', 'display_type' => 'header', + 'is_private_room_hidden' => null, ), array( 'id' => '2', 'frame_key' => 'frame_2', 'display_type' => 'major', + 'is_private_room_hidden' => null, ), array( 'id' => '3', 'frame_key' => 'frame_3', 'display_type' => 'major', + 'is_private_room_hidden' => null, ), array( 'id' => '4', 'frame_key' => 'frame_4', 'display_type' => 'minor', + 'is_private_room_hidden' => null, ), array( 'id' => '5', 'frame_key' => 'frame_5', 'display_type' => 'footer', + 'is_private_room_hidden' => null, ), ); +/** + * Initialize the fixture. + * + * @return void + */ + public function init() { + require_once App::pluginPath('Menus') . 'Config' . DS . 'Schema' . DS . 'schema.php'; + $this->fields = (new MenusSchema())->tables[Inflector::tableize($this->name)]; + parent::init(); + } } diff --git a/Test/Fixture/MenuFramesPageFixture.php b/Test/Fixture/MenuFramesPageFixture.php index bed6072..c78ae31 100644 --- a/Test/Fixture/MenuFramesPageFixture.php +++ b/Test/Fixture/MenuFramesPageFixture.php @@ -17,27 +17,6 @@ */ class MenuFramesPageFixture extends CakeTestFixture { -/** - * Fields - * - * @var array - */ - public $fields = array( - 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'), - 'frame_key' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), - 'page_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false), - 'is_hidden' => array('type' => 'boolean', 'null' => true, 'default' => null), - 'folder_type' => array('type' => 'boolean', 'null' => true, 'default' => null), - 'created_user' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false, 'comment' => '作成者'), - 'created' => array('type' => 'datetime', 'null' => true, 'default' => null, 'comment' => '作成日時'), - 'modified_user' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false, 'comment' => '更新者'), - 'modified' => array('type' => 'datetime', 'null' => true, 'default' => null, 'comment' => '更新日時'), - 'indexes' => array( - 'PRIMARY' => array('column' => 'id', 'unique' => 1) - ), - 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB') - ); - /** * Records * @@ -53,4 +32,14 @@ class MenuFramesPageFixture extends CakeTestFixture { ), ); +/** + * Initialize the fixture. + * + * @return void + */ + public function init() { + require_once App::pluginPath('Menus') . 'Config' . DS . 'Schema' . DS . 'schema.php'; + $this->fields = (new MenusSchema())->tables[Inflector::tableize($this->name)]; + parent::init(); + } } diff --git a/Test/Fixture/MenuFramesRoomFixture.php b/Test/Fixture/MenuFramesRoomFixture.php index d4da9a3..e8c5437 100644 --- a/Test/Fixture/MenuFramesRoomFixture.php +++ b/Test/Fixture/MenuFramesRoomFixture.php @@ -17,26 +17,6 @@ */ class MenuFramesRoomFixture extends CakeTestFixture { -/** - * Fields - * - * @var array - */ - public $fields = array( - 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'unsigned' => false, 'key' => 'primary'), - 'frame_key' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'), - 'room_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false), - 'is_hidden' => array('type' => 'boolean', 'null' => true, 'default' => null), - 'created_user' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false, 'comment' => '作成者 | '), - 'created' => array('type' => 'datetime', 'null' => true, 'default' => null, 'comment' => '作成日時'), - 'modified_user' => array('type' => 'integer', 'null' => true, 'default' => null, 'unsigned' => false, 'comment' => '更新者 | '), - 'modified' => array('type' => 'datetime', 'null' => true, 'default' => null, 'comment' => '更新日時'), - 'indexes' => array( - 'PRIMARY' => array('column' => 'id', 'unique' => 1) - ), - 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB') - ); - /** * Records * @@ -51,4 +31,14 @@ class MenuFramesRoomFixture extends CakeTestFixture { ), ); +/** + * Initialize the fixture. + * + * @return void + */ + public function init() { + require_once App::pluginPath('Menus') . 'Config' . DS . 'Schema' . DS . 'schema.php'; + $this->fields = (new MenusSchema())->tables[Inflector::tableize($this->name)]; + parent::init(); + } } diff --git a/VERSION.txt b/VERSION.txt index fa7adc7..86fb650 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.5 +3.3.7