forked from openml-labs/server-demo
-
Notifications
You must be signed in to change notification settings - Fork 7
48 lines (39 loc) · 1.23 KB
/
pytest-tests.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
# This workflow will install Python dependencies, run tests and pre-commit hook with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Run Unit Test via Pytest
on:
pull_request:
branches: [ "develop" ]
# allows to manually start a workflow run from the GitHub UI or using the GitHub API.
workflow_dispatch:
permissions:
contents: read
jobs:
build:
strategy:
matrix:
python-version: ["3.11"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Setup Python virtual environment
run: |
python3.11 -m venv venv
source venv/bin/activate
- name: Install dependencies
run: |
source venv/bin/activate
python -m pip install ".[dev]"
pre-commit install
- name: pre-commit check
run: |
source venv/bin/activate
pre-commit run --all
- name: Test with pytest
run: |
source venv/bin/activate
pytest ./src/tests/