-
-
Notifications
You must be signed in to change notification settings - Fork 605
76 lines (73 loc) · 2.4 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Run Tests
on: [push]
jobs:
test:
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
fail-fast: false
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v3
- name: set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: set up Poetry
uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: "1.6.1"
- name: install dependencies
run: |
set -x
poetry config virtualenvs.create false
poetry install --all-extras
# install packages to run the examples
pip install opencv-python opencv-contrib-python-headless httpx isort replicate langchain openai simpy tortoise-orm
pip install -r tests/requirements.txt
# try fix issue with importlib_resources
pip install importlib-resources
- name: test startup
run: ./test_startup.sh
- name: setup chromedriver
uses: nanasess/setup-chromedriver@v2.2.0
- name: pytest
run: pytest
- name: upload screenshots
uses: actions/upload-artifact@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: pytest-screenshots
path: tests/screenshots
slack:
needs:
- test
if: always() # also execute when test fail
runs-on: ubuntu-latest
steps:
- name: Determine if we need to notify
uses: Jimdo/should-i-notify-action@main
id: should_notify
with:
needs_context: ${{ toJson(needs) }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Check if secret exists
id: check_secret
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_ROBOTICS_CI_WEBHOOK }}
run: |
if [[ -z "$SLACK_WEBHOOK" ]]; then
echo "slack_webhook_exists=false" >> $GITHUB_ENV
else
echo "slack_webhook_exists=true" >> $GITHUB_ENV
fi
- name: Slack workflow notification
if: steps.should_notify.outputs.should_send_message == 'yes' && env.slack_webhook_exists == 'true'
uses: Gamesight/slack-workflow-status@master
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
slack_webhook_url: ${{ secrets.SLACK_ROBOTICS_CI_WEBHOOK }}
channel: "robotik-ci"
name: "NiceGUI"