-
Notifications
You must be signed in to change notification settings - Fork 5
90 lines (77 loc) · 2.34 KB
/
Copy pathci.yml
File metadata and controls
90 lines (77 loc) · 2.34 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: CI
on:
push:
branches: ["**"]
tags: ["v*"]
paths-ignore:
- 'README.md'
- 'docs/**'
- 'images/**'
- 'Images/**'
pull_request:
paths-ignore:
- 'README.md'
- 'docs/**'
- 'images/**'
- 'Images/**'
jobs:
tests:
name: Tests (Python ${{ matrix.python-version }})
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies (including ControlSerial)
run: |
python -m pip install --upgrade pip
pip install "git+https://github.com/Alienor134/UC2_Fluorescence_microscope.git#subdirectory=ControlSerial"
pip install -e .
- name: Run unit and (optional) hardware tests
run: |
python run_tests.py
build-executable:
name: Build interface_motors.exe
runs-on: windows-latest
needs: tests
if: github.ref_type == 'tag'
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies and PyInstaller
run: |
python -m pip install --upgrade pip
pip install "git+https://github.com/Alienor134/UC2_Fluorescence_microscope.git#subdirectory=ControlSerial"
pip install -e .
pip install pyinstaller
- name: Build standalone executable
run: |
pyinstaller --onefile --noconsole ControlMotors/interface_motors.py
- name: Upload executable artifact
uses: actions/upload-artifact@v4
with:
name: interface_motors-exe
path: dist/interface_motors.exe
- name: Create draft GitHub Release with executable
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
tag_name: ${{ github.ref_name }}
name: ControlMotors ${{ github.ref_name }}
files: |
dist/interface_motors.exe