-
Notifications
You must be signed in to change notification settings - Fork 7
70 lines (62 loc) · 1.64 KB
/
tests.yaml
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
69
70
name: style | tests
on:
push:
branches:
- main
tags:
- "*.*.*"
paths-ignore:
- README.md
pull_request:
branches:
- main
jobs:
style:
name: Style
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.10']
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -U flake8
- name: PEP checks
run: >
flake8 mouser_cli.py run_tests.py mouser/*
tests:
name: Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.10']
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -U poetry
- name: Poetry setup
run: |
poetry install
- name: Run tests
run: |
poetry run python run_tests.py
poetry run mouser order get --number $MOUSER_ORDER_NUMBER | egrep '"OrderID":' >/dev/null 2>&1
env:
MOUSER_ORDER_API_KEY: ${{ secrets.MOUSER_ORDER_API_KEY }}
MOUSER_PART_API_KEY: ${{ secrets.MOUSER_PART_API_KEY }}
MOUSER_ORDER_NUMBER: ${{ secrets.MOUSER_ORDER_NUMBER }}
- name: Run build
run: |
poetry build