forked from CLCMacTeam/besapi
-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (67 loc) · 2.16 KB
/
test_build.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
---
name: test_build
on:
push:
paths:
- "src/**.py"
- "tests/**.py"
- "setup.cfg"
- "MANIFEST.in"
- "pyproject.toml"
- "requirements.txt"
- ".github/workflows/test_build.yaml"
- ".github/workflows/tag_and_release.yaml"
pull_request:
paths:
- "src/**.py"
- "tests/**.py"
- "setup.cfg"
- "MANIFEST.in"
- "pyproject.toml"
- "requirements.txt"
- ".github/workflows/test_build.yaml"
- ".github/workflows/tag_and_release.yaml"
jobs:
test_build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
# https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
python-version: ["3.7", "3"]
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install build tools
run: pip install setuptools wheel build pyinstaller
- name: Install requirements
run: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run Tests - Source
run: python tests/tests.py
- name: Run build
run: python3 -m build
- name: Get Wheel File Path
id: getwheelfile
shell: bash
run: echo "::set-output name=wheelfile::$(find "dist" -type f -name "*.whl")"
- name: Test pip install of wheel
shell: bash
run: pip install $(find "dist" -type f -name "*.whl")
- name: Test python import besapi
shell: bash
run: python -c "import besapi"
- name: Test python import bescli
shell: bash
run: python -c "import bescli"
- name: Test python bescli
shell: bash
run: python -m bescli ls logout clear error_count version exit
- name: Run Tests - Pip
run: python tests/tests.py --test_pip
- name: Test pyinstaller build
run: pyinstaller --clean --collect-all besapi --onefile ./src/bescli/bescli.py
- name: Test bescli binary
run: ./dist/bescli ls logout clear error_count version exit