mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-12-30 16:47:19 +00:00
100 lines
3.0 KiB
YAML
100 lines
3.0 KiB
YAML
name: Examples tests
|
|
|
|
on:
|
|
workflow_dispatch: # Activate this workflow manually
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
paths:
|
|
- examples/**
|
|
types:
|
|
- opened
|
|
- reopened
|
|
- synchronize
|
|
- ready_for_review
|
|
|
|
env:
|
|
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
|
|
PYTHON_VERSION: "3.8"
|
|
|
|
jobs:
|
|
tests:
|
|
name: Examples
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
elasticsearch:
|
|
image: elasticsearch:7.17.6
|
|
env:
|
|
discovery.type: "single-node"
|
|
ES_JAVA_OPTS: "-Xms128m -Xmx256m"
|
|
ports:
|
|
- 9200:9200
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ env.PYTHON_VERSION }}
|
|
|
|
- name: Install Haystack
|
|
run: pip install .[all,dev]
|
|
|
|
- name: Run
|
|
run: pytest examples/
|
|
|
|
- uses: slackapi/slack-github-action@v1.23.0
|
|
if: failure() && github.ref == 'refs/heads/main'
|
|
with:
|
|
payload: |
|
|
{
|
|
"blocks": [
|
|
{
|
|
"type": "context",
|
|
"elements": [
|
|
{
|
|
"type": "image",
|
|
"image_url": "https://avatars.githubusercontent.com/u/${{ github.actor_id }}?v=4",
|
|
"alt_text": "Actor"
|
|
},
|
|
{
|
|
"type": "mrkdwn",
|
|
"text": "*<https://github.com/${{ github.actor }}|${{ github.actor }}>*"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "section",
|
|
"text": {
|
|
"type": "mrkdwn",
|
|
"text": "Job ${{ github.job }} in workflow <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/workflow/|${{ github.workflow }}>"
|
|
}
|
|
},
|
|
{
|
|
"type": "context",
|
|
"elements": [
|
|
{
|
|
"type": "mrkdwn",
|
|
"text": "Triggered by ${{ github.event_name }} for ${{ github.ref_type }} `${{ github.ref_name }}`"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "context",
|
|
"elements": [
|
|
{
|
|
"type": "image",
|
|
"image_url": "https://github.githubassets.com/favicons/favicon.png",
|
|
"alt_text": "Github logo"
|
|
},
|
|
{
|
|
"type": "mrkdwn",
|
|
"text": "<https://github.com/${{ github.repository }}/|${{ github.repository }}> Run <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}/|#${{ github.run_number }} | Attempt #${{ github.run_attempt }}>"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|