-
Notifications
You must be signed in to change notification settings - Fork 51
148 lines (142 loc) · 4.09 KB
/
build-main.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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Build Main
on:
workflow_dispatch:
push:
branches:
- main
schedule:
# <minute [0,59]> <hour [0,23]> <day of the month [1,31]> <month of the year [1,12]> <day of the week [0,6]>
# https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07
# Run every Monday at 18:00:00 UTC (Monday at 10:00:00 PST)
- cron: "0 18 * * 1"
jobs:
test-core-lib:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, '3.10', 3.11]
os: [
ubuntu-latest,
windows-latest,
macos-latest,
]
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install .[test]
- uses: actions/cache@v2
id: cache
with:
path: aicsimageio/tests/resources
key: ${{ hashFiles('scripts/TEST_RESOURCES_HASH.txt') }}
- name: Download Test Resources
if: steps.cache.outputs.cache-hit != 'true'
run: |
python scripts/download_test_resources.py --debug
- name: Run tests with Tox
# Run tox using the version of Python in `PATH`
run: tox -e py
- name: Upload codecov
uses: codecov/codecov-action@v2
test-readers:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, '3.10', 3.11]
os: [
ubuntu-20.04,
windows-latest,
macos-11,
]
tox-env: [
bioformats,
czi,
base-imageio,
dv,
lif,
nd2,
sldy,
bfio,
omezarr,
]
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/setup-java@v2
with:
distribution: "temurin"
java-version: "11"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install .[test]
- uses: actions/cache@v2
id: cache
with:
path: aicsimageio/tests/resources
key: ${{ hashFiles('scripts/TEST_RESOURCES_HASH.txt') }}
- name: Download Test Resources
if: steps.cache.outputs.cache-hit != 'true'
run: |
python scripts/download_test_resources.py --debug
- name: Run tests with Tox
# Run tox using the version of Python in `PATH`
run: tox -e ${{ matrix.tox-env }}
- name: Upload codecov
uses: codecov/codecov-action@v2
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.11
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install .[test]
- name: Lint
run: tox -e lint
publish:
if: "contains(github.event.head_commit.message, 'Bump version')"
needs: [test-core-lib, test-readers, lint]
runs-on: ubuntu-latest
# Specifying a GitHub environment is optional, but strongly encouraged
environment: release
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.11
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
- name: Build Package
run: |
python setup.py sdist bdist_wheel
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1