From c0b56f974c54db30e41d4cafda04931fafd41046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalvis=20Kalni=C5=86=C5=A1?= Date: Tue, 4 Feb 2025 11:54:42 +0000 Subject: [PATCH] wip: test github action on push event --- .github/workflows/ci-pr.yml | 20 ------------- .github/workflows/ci-test.yml | 55 +++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/ci-test.yml diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index a59925934e..35ff3754ce 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -31,23 +31,3 @@ jobs: needs: changes uses: ./.github/workflows/npm-test.yml if: needs.changes.outputs.npm-test == 'true' - - # for testing - on-failure: - runs-on: ubuntu-latest - if: ${{ always() && (needs.darker.result == 'failure' || needs.darker.result == 'timed_out' || needs.pytest.result == 'failure' || needs.pytest.result == 'timed_out' || needs.npm-test.result == 'failure' || needs.npm-test.result == 'timed_out') }} - needs: - - darker - - pytest - - npm-test - steps: - - name: Send a stream message - uses: zulip/github-actions-zulip/send-message@v1 - with: - api-key: ${{ secrets.ZULIP_API_KEY_GITHUB_ACTIONS_BOT }} - email: "github-actions-bot@chat.kobotoolbox.org" - organization-url: "https://chat.kobotoolbox.org" - type: "stream" - to: "Kobo Dev" - topic: "Github Actions (main)" - content: "[Run #${{github.run_number}}](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}) failed on `main` at [${{ toJson(github.event.commits) }}](${{ github.event.compare }}) :boom: debug event_name: ${{ toJson(github.event_name) }} debug event: ${{ toJson(github.event) }}" diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml new file mode 100644 index 0000000000..d56c07359a --- /dev/null +++ b/.github/workflows/ci-test.yml @@ -0,0 +1,55 @@ +name: ci + +on: + push: + branches: [ kalvis/github-actions-bot ] + +jobs: + changes: + runs-on: ubuntu-latest + permissions: { pull-requests: read } + steps: + - uses: actions/checkout@v4 + - id: filter + uses: dorny/paths-filter@v3 + name: Detect changed files + with: { filters: .github/filters.yml } + outputs: + darker: ${{ steps.filter.outputs.darker }} + pytest: ${{ steps.filter.outputs.pytest }} + npm-test: ${{ steps.filter.outputs.npm-test }} + + darker: + needs: changes + uses: ./.github/workflows/darker.yml + if: needs.changes.outputs.darker == 'true' + + pytest: + needs: changes + uses: ./.github/workflows/pytest.yml + if: needs.changes.outputs.pytest == 'true' + + npm-test: + needs: changes + uses: ./.github/workflows/npm-test.yml + if: needs.changes.outputs.npm-test == 'true' + + # for testing + on-failure: + runs-on: ubuntu-latest + if: ${{ always() && (needs.darker.result == 'failure' || needs.darker.result == 'timed_out' || needs.pytest.result == 'failure' || needs.pytest.result == 'timed_out' || needs.npm-test.result == 'failure' || needs.npm-test.result == 'timed_out') }} + needs: + - darker + - pytest + - npm-test + steps: + - name: Send a stream message + uses: zulip/github-actions-zulip/send-message@v1 + with: + api-key: ${{ secrets.ZULIP_API_KEY_GITHUB_ACTIONS_BOT }} + email: "github-actions-bot@chat.kobotoolbox.org" + organization-url: "https://chat.kobotoolbox.org" + type: "stream" + to: "Kobo Dev" + topic: "Github Actions (main)" + content: "[Run #${{github.run_number}}](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}) failed on `main` at [${{ toJson(github.event.commits[0]) }}](${{ github.event.compare }}) :boom: @**Kalvis Kalniņš** please fix the main and emoji this message to mark it as resolved."