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] - 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": "**" } ] }, { "type": "section", "text": { "type": "mrkdwn", "text": "Job ${{ github.job }} in 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": " Run " } ] } ] }