From 61cc0cff2bdc58c60a67f139be4acb9779a24604 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 30 Nov 2023 21:02:26 +0100 Subject: [PATCH] Split steps even more --- .woodpecker/.build.yml | 1 + .woodpecker/.cs.yml | 35 ++++++++++++++++++++++ .woodpecker/.test.yml | 9 ++++-- tests/danog/MadelineProto/EntitiesTest.php | 1 - tests/test.sh | 7 +++-- 5 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 .woodpecker/.cs.yml diff --git a/.woodpecker/.build.yml b/.woodpecker/.build.yml index e51c29155..f5b58cfbf 100644 --- a/.woodpecker/.build.yml +++ b/.woodpecker/.build.yml @@ -64,3 +64,4 @@ services: depends_on: - build-docker - test + - cs diff --git a/.woodpecker/.cs.yml b/.woodpecker/.cs.yml new file mode 100644 index 000000000..047bfe5d7 --- /dev/null +++ b/.woodpecker/.cs.yml @@ -0,0 +1,35 @@ +matrix: + php: + - "8.1" + platform: + - linux/aarch64 + +labels: + platform: ${platform} + +clone: + git: + when: + event: + - tag + - push + - pull_request + image: woodpeckerci/plugin-git:2.1.0 + settings: + depth: 1 + lfs: false + recursive: false + tags: true + +steps: + cs: + group: test + image: danog/madelineproto:next + when: + event: + - pull_request + - tag + - push + commands: + - apk add bash + - tests/test.sh cs \ No newline at end of file diff --git a/.woodpecker/.test.yml b/.woodpecker/.test.yml index 5af46b35a..a245f27f8 100644 --- a/.woodpecker/.test.yml +++ b/.woodpecker/.test.yml @@ -37,7 +37,7 @@ steps: - apk add bash - tests/test.sh phpunit - test_pr: + test_light: group: test image: danog/madelineproto:next when: @@ -48,7 +48,7 @@ steps: - apk add bash - tests/test.sh phpunit-light - cs: + psalm: group: test image: danog/madelineproto:next when: @@ -58,7 +58,7 @@ steps: - push commands: - apk add bash - - tests/test.sh cs + - tests/test.sh psalm handshake: group: test @@ -71,3 +71,6 @@ steps: commands: - apk add bash - tests/test.sh handshake + +depends_on: + - build-docker \ No newline at end of file diff --git a/tests/danog/MadelineProto/EntitiesTest.php b/tests/danog/MadelineProto/EntitiesTest.php index 7e0d49367..4d2706d25 100644 --- a/tests/danog/MadelineProto/EntitiesTest.php +++ b/tests/danog/MadelineProto/EntitiesTest.php @@ -89,7 +89,6 @@ class EntitiesTest extends TestCase $resultMTProto = self::sendMessage(message: "```\n".Tools::markdownCodeblockEscape($html)."\n```", parse_mode: $mode); $result = self::MTProtoToBotAPI($resultMTProto); $this->assertEquals($html, rtrim($result['text'])); - $result['entities'][0]['language'] = ''; // Telegram now has automatic language detection $this->assertEquals([['offset' => 0, 'length' => StrTools::mbStrlen($html), 'language' => '', 'type' => 'pre']], $result['entities']); } } diff --git a/tests/test.sh b/tests/test.sh index bfa0d7f84..656d4979d 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -20,8 +20,6 @@ php tests/jit.php php tests/lock_setup.php if [ "$1" == "cs" ]; then - composer psalm - rmdir docs curl -L https://github.com/danog/MadelineProtoDocs/archive/refs/heads/master.tar.gz | tar -xz mv MadelineProtoDocs-master/ docs @@ -43,6 +41,11 @@ if [ "$1" == "handshake" ]; then exit 0 fi +if [ "$1" == "psalm" ]; then + composer psalm + exit 0 +fi + if [ "$1" == "phpunit" ]; then composer test exit 0