summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorElias Müller <elias.mr1@gmail.com>2022-07-09 18:24:16 +0200
committerjaseg <136313+jaseg@users.noreply.github.com>2022-07-11 12:44:47 +0200
commitdffd89630bb7728327fe2a3f140d17e6b8fb9eb1 (patch)
treedc52daff892e95ca4af166bfa0ee242f800fa0a1 /.github
parent721cff015b46b4f7bab9d4911fa55856519d9aaa (diff)
downloadpython-mpv-dffd89630bb7728327fe2a3f140d17e6b8fb9eb1.tar.gz
python-mpv-dffd89630bb7728327fe2a3f140d17e6b8fb9eb1.tar.bz2
python-mpv-dffd89630bb7728327fe2a3f140d17e6b8fb9eb1.zip
Add test workflow
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/tests.yml50
1 files changed, 50 insertions, 0 deletions
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
new file mode 100644
index 0000000..a1b02ee
--- /dev/null
+++ b/.github/workflows/tests.yml
@@ -0,0 +1,50 @@
+name: 'Tests'
+
+
+on:
+ push:
+ branches: [ '**' ]
+
+
+defaults:
+ run:
+ shell: bash
+
+
+jobs:
+ test-python:
+ runs-on: ubuntu-22.04
+ strategy:
+ matrix:
+ python-version: [ '3.10' ] # '3.7', '3.8', '3.9'
+ name: 'Python'
+ steps:
+ - uses: actions/checkout@v2
+ - name: 'Install Python'
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python-version }}
+ - name: 'Install pip'
+ run: |
+ function execute() { echo -e "\033[0;34m$*\033[0m"; "$@"; }
+ execute python -m pip install --upgrade pip
+ - name: 'Update Packages'
+ run: |
+ function execute() { echo -e "\033[0;34m$*\033[0m"; "$@"; }
+ execute sudo apt update -y && sudo apt upgrade -y
+ - name: 'Install Dependencies'
+ run: |
+ function execute() { echo -e "\033[0;34m$*\033[0m"; "$@"; }
+ execute sudo apt install -y libmpv1 xvfb
+ - name: 'Create Virtual Environment'
+ run: |
+ function execute() { echo -e "\033[0;34m$*\033[0m"; "$@"; }
+ execute python -m venv venv
+ execute source venv/bin/activate
+ execute python -m pip install wheel
+ execute python -m pip install -r tests/requirements.txt
+ - name: 'Run Python Tests'
+ run: |
+ function execute() { echo -e "\033[0;34m$*\033[0m"; "$@"; }
+ source venv/bin/activate
+ execute python -m pytest