-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (47 loc) · 1.55 KB
/
ci.yml
File metadata and controls
50 lines (47 loc) · 1.55 KB
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
name: Verify code quality and ability to build
on:
push:
branches: [ main ]
pull_request:
types: [ opened, synchronize, reopened ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
pip install -e .[dev]
- name: Lint with flake8
run: |
mkdir -p junit
pip install flake8_formatter_junit_xml
flake8 --format junit-xml --output-file junit/flake8_report.xml --exit-zero
- name: Test with pytest
run: pytest --junitxml=junit/pytest-results.xml
env:
CUSTOM_VISION_KEY: ${{ secrets.CUSTOM_VISION_KEY }}
CUSTOM_VISION_ENDPOINT: ${{ secrets.CUSTOM_VISION_ENDPOINT }}
STORAGE_ACCOUNT_KEY: ${{ secrets.STORAGE_ACCOUNT_KEY }}
STORAGE_ACCOUNT_NAME: ${{ secrets.STORAGE_ACCOUNT_NAME }}
STORAGE_ACCOUNT_CONTAINER_NAME: ${{ secrets.STORAGE_ACCOUNT_CONTAINER_NAME }}
- name: Upload pytest test results
uses: actions/upload-artifact@v2
with:
name: testing-results
path: junit/*.xml
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
- name: Test building package
run: python -m build
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: pypi-package
path: dist/*.whl