From dee6ea28527de9cc4ee00c17b3323539f4b13d3a Mon Sep 17 00:00:00 2001 From: rcorniere Date: Wed, 26 Feb 2020 16:38:43 +0100 Subject: [PATCH 1/8] Test fail with notif --- .github/workflows/main.yml | 25 ++++++++++++++++++++++++- dummy_test.go | 7 +++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 dummy_test.go diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 36c4447..7c7b92c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,6 +11,15 @@ jobs: runs-on: ubuntu-latest name: workflow that pushes repo news to xmpp server steps: + - name: Set up Go 1.13 + uses: actions/setup-go@v1 + with: + go-version: 1.13 + id: go + - uses: actions/checkout@v1 + - name: Run tests + run: | + go test ./... -v -race -coverprofile cover.out -covermode=atomic - name: Checkout uses: actions/checkout@v2 - name: push_info_step @@ -61,4 +70,18 @@ jobs: message: | ${{ github.actor }} edited the following PR : ${{ github.event.pull_request.html_url }} with message : ${{ github.event.pull_request.title }} - correspondent_is_room: true \ No newline at end of file + correspondent_is_room: true + - name: _info_step + id: pull_request_edit + uses: ./ + # Will only get triggered when a pull request to master is created + if: github.event_name == 'pull_request' && github.event.action == 'edited' + with: # Set the secrets as inputs + login: ${{ secrets.bot_username }} + pass: ${{ secrets.bot_password }} + server_domain: ${{ secrets.server_rooms_domain }} + correspondant: ${{ secrets.room_correspondent }} + message: | + ${{ github.actor }} edited the following PR : ${{ github.event.pull_request.html_url }} with message : + ${{ github.event.pull_request.title }} + correspondent_is_room: true diff --git a/dummy_test.go b/dummy_test.go new file mode 100644 index 0000000..0883cc4 --- /dev/null +++ b/dummy_test.go @@ -0,0 +1,7 @@ +package main + +import "testing" + +func TestAlwaysFails(t *testing.T) { + t.Fatal("I always fail") +} From 11e06e589252c1d690b8983c9d2d91f8d37615fa Mon Sep 17 00:00:00 2001 From: rcorniere Date: Wed, 26 Feb 2020 16:47:07 +0100 Subject: [PATCH 2/8] Test fail with notif --- .github/workflows/main.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7c7b92c..1a88a8e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,6 +20,25 @@ jobs: - name: Run tests run: | go test ./... -v -race -coverprofile cover.out -covermode=atomic + - name: Tests fail notif + if: failure() + id: test_fail_notif + uses: ./ + with: # Set the secrets as inputs + # Login expects the bot's bare jid (user@domain) + login: ${{ secrets.bot_username }} + pass: ${{ secrets.bot_password }} + server_domain: ${{ secrets.server_rooms_domain }} + # Correspondent is the intended recipient of the notification. + # If it is a single user, the bare Jid is expected (jid without resource) + # If it is a chat room, only the name of it is expected, and "server_domain" will be used to complete the jid + correspondant: ${{ secrets.room_correspondent }} + # Port is optional. Defaults to 5222 + server_port: ${{ secrets.server_port }} + message: | + tests for the following commit have failed : ${{github.event.pull request.html_url}} + # Boolean to indicate if correspondent should be treated as a room (true) or a single user + correspondent_is_room: true - name: Checkout uses: actions/checkout@v2 - name: push_info_step From 251d2c4b8c0499ccab559d04939c247040c4c26b Mon Sep 17 00:00:00 2001 From: rcorniere Date: Wed, 26 Feb 2020 16:48:28 +0100 Subject: [PATCH 3/8] Test fail with notif --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1a88a8e..bf23607 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,7 +36,7 @@ jobs: # Port is optional. Defaults to 5222 server_port: ${{ secrets.server_port }} message: | - tests for the following commit have failed : ${{github.event.pull request.html_url}} + tests for the following commit have failed : ${{github.event.pull_request.html_url}} # Boolean to indicate if correspondent should be treated as a room (true) or a single user correspondent_is_room: true - name: Checkout From 3dac14fc9fa19834c4ea73b7a8f7bb2150c5fcf9 Mon Sep 17 00:00:00 2001 From: rcorniere Date: Wed, 26 Feb 2020 16:49:52 +0100 Subject: [PATCH 4/8] Test fail with notif --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bf23607..90a40d7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,7 +36,7 @@ jobs: # Port is optional. Defaults to 5222 server_port: ${{ secrets.server_port }} message: | - tests for the following commit have failed : ${{github.event.pull_request.html_url}} + tests for the following commit have failed : ${{ github.event.pull_request.html_url }} # Boolean to indicate if correspondent should be treated as a room (true) or a single user correspondent_is_room: true - name: Checkout From 3a47ca97121dfd22f0a22e2037d3a75828768391 Mon Sep 17 00:00:00 2001 From: rcorniere Date: Wed, 26 Feb 2020 16:51:09 +0100 Subject: [PATCH 5/8] Test fail with notif --- .github/workflows/main.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 90a40d7..38c7edc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -90,17 +90,3 @@ jobs: ${{ github.actor }} edited the following PR : ${{ github.event.pull_request.html_url }} with message : ${{ github.event.pull_request.title }} correspondent_is_room: true - - name: _info_step - id: pull_request_edit - uses: ./ - # Will only get triggered when a pull request to master is created - if: github.event_name == 'pull_request' && github.event.action == 'edited' - with: # Set the secrets as inputs - login: ${{ secrets.bot_username }} - pass: ${{ secrets.bot_password }} - server_domain: ${{ secrets.server_rooms_domain }} - correspondant: ${{ secrets.room_correspondent }} - message: | - ${{ github.actor }} edited the following PR : ${{ github.event.pull_request.html_url }} with message : - ${{ github.event.pull_request.title }} - correspondent_is_room: true From bba7fed581d38ed52a5a7f38d91644f76238bb3c Mon Sep 17 00:00:00 2001 From: rcorniere Date: Wed, 26 Feb 2020 16:53:45 +0100 Subject: [PATCH 6/8] Test fail with notif --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 38c7edc..f5e698c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,6 +20,8 @@ jobs: - name: Run tests run: | go test ./... -v -race -coverprofile cover.out -covermode=atomic + - name: Checkout + uses: actions/checkout@v2 - name: Tests fail notif if: failure() id: test_fail_notif @@ -39,8 +41,6 @@ jobs: tests for the following commit have failed : ${{ github.event.pull_request.html_url }} # Boolean to indicate if correspondent should be treated as a room (true) or a single user correspondent_is_room: true - - name: Checkout - uses: actions/checkout@v2 - name: push_info_step id: push uses: ./ From e5f0ef1a358fbd4933f94ff45c9bca37835b2b2c Mon Sep 17 00:00:00 2001 From: rcorniere Date: Thu, 27 Feb 2020 10:29:04 +0100 Subject: [PATCH 7/8] Try failed tests notifs --- .github/workflows/main.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f5e698c..2f00ef7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,17 +11,11 @@ jobs: runs-on: ubuntu-latest name: workflow that pushes repo news to xmpp server steps: - - name: Set up Go 1.13 - uses: actions/setup-go@v1 - with: - go-version: 1.13 - id: go - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 - name: Run tests run: | go test ./... -v -race -coverprofile cover.out -covermode=atomic - - name: Checkout - uses: actions/checkout@v2 - name: Tests fail notif if: failure() id: test_fail_notif From 6c535e2cb0d916d4d5843195119db298a09dee2c Mon Sep 17 00:00:00 2001 From: rcorniere Date: Thu, 27 Feb 2020 10:29:14 +0100 Subject: [PATCH 8/8] Try failed tests notifs --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2f00ef7..d8380ce 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: name: workflow that pushes repo news to xmpp server steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v2 - name: Run tests run: | go test ./... -v -race -coverprofile cover.out -covermode=atomic