-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (38 loc) · 1.17 KB
/
run-pytest.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
name: Python application test with pytest
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build_test:
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: Checkout
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@v3
- name: Checkout PR
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install Python 3
uses: actions/setup-python@v4
with:
python-version: 3.10.11
- name: Install python dependencies
run: |
pip install --upgrade pip
pip install --no-cache-dir --upgrade setuptools
pip install --no-cache-dir --upgrade wheel
pip install -r requirements-test.txt -r requirements.txt
- name: Build Docker image
run: docker build -t test .
- name: Run tests with pytest and generate report
run: >
docker run
--name biproject
--network=host
-v "$(pwd)"/tests:/opt/airflow/tests
--entrypoint pytest test /opt/airflow/tests