haystack/.github/workflows/examples-tests.yml
Massimiliano Pippi d322beed6c
build: do not install 'dev' extras with 'all' (#4888)
* do not install 'dev' with 'all'

* some fixes around
2023-05-11 19:24:47 +02:00

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 }}>"
}
]
}
]
}