-
Notifications
You must be signed in to change notification settings - Fork 33
68 lines (55 loc) · 1.9 KB
/
samples.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
name: Python Samples Script
on:
schedule:
- cron: '0 */12 * * *'
jobs:
run-selenium:
runs-on: ubuntu-latest
env:
WEBHOOK_URL: ${{ secrets.WEBHOOK }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python 3
uses: actions/setup-python@v3
with:
python-version: 3.x
- name: Install dependencies
run: |
pip install selenium
pip install requests
- name: Install FFmpeg
run: |
sudo apt-get update
sudo apt-get install -y ffmpeg
- name: Install SRT
run: |
git clone https://github.com/Haivision/srt.git
cd srt
sudo apt-get install tclsh pkg-config cmake libssl-dev build-essential
./configure
make
sudo make install
cd ..
- name: Install Chrome
run: |
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
- name: Install ChromeDriver
run: |
wget https://storage.googleapis.com/chrome-for-testing-public/131.0.6778.69/linux64/chromedriver-linux64.zip
unzip chromedriver-linux64.zip
cd chromedriver-linux64
sudo mv chromedriver /usr/bin/chromedriver
sudo chown root:root /usr/bin/chromedriver
sudo chmod +x /usr/bin/chromedriver
- name: Run Selenium script
run: |
python Selenium/antmedia-samples.py
- name: Install jq
run: sudo apt-get install -y jq
- name: Send Slack notification on failure
if: ${{ failure() || cancelled() }}
run: |
SLACK_PAYLOAD=$(jq -n --arg text "<@U01UMD36SQ0> GitHub Workflow failed for ${{ github.repository }}" '{text: $text, icon_emoji: ":x:"}')
curl -X POST -H 'Content-type: application/json' --data "$SLACK_PAYLOAD" ${{ env.WEBHOOK_URL }}