From 67c5217394180c54527b5fc2a756dac724f9ed04 Mon Sep 17 00:00:00 2001 From: Syfaro Date: Sun, 26 Jul 2020 23:07:24 -0500 Subject: [PATCH 1/3] Attempt to use GitHub Actions. --- .github/workflows/test.yml | 28 ++++++++++++++++++++++++++++ .travis.yml | 6 ------ 2 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..fc48c2f --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,28 @@ +name: Test + +on: [push, pull_request] + +jobs: + build: + name: Test + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.x + uses: actions/setup-go@v2 + with: + go-version: ^1.14 + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Build + run: go build -v . + + - name: Test + run: go test -coverprofile=coverage.out -covermode=atomic -v . + + - name: Upload coverage report + uses: codecov/codecov-action@v1 + with: + file: ./coverage.out diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 712ce95..0000000 --- a/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: go - -go: - - '1.13' - - '1.14' - - tip From e6e2a9f3ef2b66d3edaa3719146477442c65f97e Mon Sep 17 00:00:00 2001 From: Syfaro Date: Thu, 5 Nov 2020 13:48:39 -0500 Subject: [PATCH 2/3] Update Go version, fix duplicate runs. --- .github/workflows/test.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fc48c2f..48b2859 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,11 @@ name: Test -on: [push, pull_request] +on: + push: + branches: + - master + - develop + pull_request: jobs: build: @@ -10,7 +15,7 @@ jobs: - name: Set up Go 1.x uses: actions/setup-go@v2 with: - go-version: ^1.14 + go-version: ^1.15 id: go - name: Check out code into the Go module directory From b52a9399c92a1a24fc855d079b382aab6ec7884d Mon Sep 17 00:00:00 2001 From: Syfaro Date: Thu, 5 Nov 2020 13:58:19 -0500 Subject: [PATCH 3/3] Fix Imgur issue. --- bot_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bot_test.go b/bot_test.go index 3229a8e..b490d8d 100644 --- a/bot_test.go +++ b/bot_test.go @@ -526,9 +526,8 @@ func TestSendWithMediaGroup(t *testing.T) { bot, _ := getBot(t) cfg := NewMediaGroup(ChatID, []interface{}{ - NewInputMediaPhoto("https://i.imgur.com/unQLJIb.jpg"), - NewInputMediaPhoto("https://i.imgur.com/J5qweNZ.jpg"), - NewInputMediaVideo("https://i.imgur.com/F6RmI24.mp4"), + NewInputMediaPhoto("https://github.com/go-telegram-bot-api/telegram-bot-api/raw/0a3a1c8716c4cd8d26a262af9f12dcbab7f3f28c/tests/image.jpg"), + NewInputMediaVideo("https://github.com/go-telegram-bot-api/telegram-bot-api/raw/0a3a1c8716c4cd8d26a262af9f12dcbab7f3f28c/tests/video.mp4"), }) messages, err := bot.SendMediaGroup(cfg) @@ -540,7 +539,7 @@ func TestSendWithMediaGroup(t *testing.T) { t.Error() } - if len(messages) != 3 { + if len(messages) != 2 { t.Error() } }