Skip to content

Commit 76d6a45

Browse files
committed
ci
1 parent 95ec9c8 commit 76d6a45

32 files changed

+10
-184
lines changed

.github/workflows/matlab.yml

Lines changed: 9 additions & 183 deletions
Original file line numberDiff line numberDiff line change
@@ -1,193 +1,19 @@
1-
name: Build Python module
1+
name: MATLAB Tests
22

3+
# Controls when the action will run.
34
on: [push]
45

56
jobs:
6-
test_rust:
7-
runs-on: ubuntu-22.04
8-
steps:
9-
- uses: actions/checkout@v3
10-
- run: |
11-
cd rust
12-
cargo test
13-
14-
build_lin:
15-
runs-on: ubuntu-22.04
16-
steps:
17-
- uses: actions/checkout@v3
18-
- name: Build testing docker container
19-
run: |
20-
docker build -f python/Dockerfile -t testing .
21-
- name: Build
22-
run: |
23-
docker run \
24-
-v$(pwd):/app \
25-
-w/app/python \
26-
testing \
27-
bash -c "
28-
\$PYBIN/python setup.py install
29-
\$PYBIN/python setup.py bdist_wheel -p manylinux2014_x86_64"
30-
- name: Test
31-
run: |
32-
docker run \
33-
-v$(pwd):/app \
34-
-w/app/python \
35-
testing \
36-
bash -c "\$PYBIN/pytest tests -v"
37-
- name: Check formatting
38-
run: |
39-
docker run \
40-
-v$(pwd):/app \
41-
-w/app/python \
42-
testing \
43-
bash -c "\$PYBIN/black --check ."
44-
45-
- uses: actions/upload-artifact@v4
46-
with:
47-
name: wheels-lin
48-
path: ./python/dist/*.whl
49-
50-
- name: Make sdist
51-
run: |
52-
docker run \
53-
-v$(pwd):/app \
54-
-w/app/python \
55-
testing \
56-
bash -c "\$PYBIN/python setup.py sdist"
57-
58-
- uses: actions/upload-artifact@v4
59-
with:
60-
name: targz
61-
path: ./python/dist/*.tar.gz
7+
run-tests:
8+
runs-on: ubuntu-latest
629

63-
build_mac:
64-
runs-on: macos-13
65-
strategy:
66-
max-parallel: 4
67-
matrix:
68-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
6910
steps:
7011
- uses: actions/checkout@v3
71-
- name: Set up Python ${{ matrix.python-version }}
72-
uses: actions/setup-python@v4
73-
with:
74-
python-version: ${{ matrix.python-version }}
75-
architecture: "x64" # (x64 or x86)
76-
- name: Install Rust
77-
run: |
78-
brew install rustup-init
79-
rustup-init -y
80-
rustup target add aarch64-apple-darwin
81-
rustup target add x86_64-apple-darwin
82-
- name: Build
83-
run: |
84-
cd python
85-
export PATH=$PATH:$HOME/.cargo/bin
86-
pip install wheel setuptools
87-
python setup.py bdist_wheel -p macosx-10.9-universal2
88-
pip install dist/*.whl
89-
- name: Test
90-
run: |
91-
cd python
92-
python -c "import wkw"
93-
pip install pytest
94-
pytest tests
95-
96-
- uses: actions/upload-artifact@v4
97-
if: ${{ matrix.python-version == '3.12' }}
98-
with:
99-
name: wheels-mac
100-
path: ./python/dist/*.whl
10112

102-
build_win:
103-
runs-on: windows-2022
104-
defaults:
105-
run:
106-
shell: bash
107-
strategy:
108-
max-parallel: 4
109-
matrix:
110-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
111-
steps:
112-
- uses: actions/checkout@v4
113-
- name: Set up Python ${{ matrix.python-version }}
114-
uses: actions/setup-python@v5
115-
with:
116-
python-version: ${{ matrix.python-version }}
117-
architecture: "x64" # (x64 or x86)
118-
- name: Build
119-
run: |
120-
cd python
121-
pip install wheel setuptools
122-
python setup.py bdist_wheel -p $(python -c "import distutils.util; print(distutils.util.get_platform())")
123-
pip install dist/*.whl
124-
- name: Test
125-
run: |
126-
cd python
127-
python -c "import wkw"
128-
pip install pytest
129-
pytest tests -k "not big_read"
130-
- name: Test (non-bash)
131-
shell: cmd
132-
run: |
133-
cd python
134-
python -c "import wkw"
135-
pytest tests -k "not big_read"
136-
137-
- uses: actions/upload-artifact@v4
138-
if: ${{ matrix.python-version == '3.12' }}
139-
with:
140-
name: wheels-win
141-
path: ./python/dist/*.whl
142-
143-
publish:
144-
needs:
145-
- test_rust
146-
- build_lin
147-
- build_mac
148-
- build_win
149-
runs-on: ubuntu-latest
150-
if: startsWith(github.event.ref, 'refs/tags')
151-
steps:
152-
- uses: actions/checkout@v4
153-
with:
154-
fetch-depth: "0"
155-
- name: Set up Python
156-
uses: actions/setup-python@v5
157-
with:
158-
python-version: "3.11"
159-
- name: Get wheels
160-
uses: actions/download-artifact@v4
161-
with:
162-
pattern: wheels-*
163-
merge-multiple: true
164-
path: dist
165-
- name: Get tar.gz
166-
uses: actions/download-artifact@v4
167-
with:
168-
name: targz
169-
path: dist
13+
- name: Setup MATLAB
14+
uses: matlab-actions/setup-matlab@v1
17015

171-
- name: Publish to PyPI
172-
uses: pypa/gh-action-pypi-publish@release/v1
16+
- name: Run wkwBuild
17+
uses: matlab-actions/run-command@v1
17318
with:
174-
user: __token__
175-
password: ${{ secrets.PYPI_PASSWORD }}
176-
skip-existing: true
177-
178-
complete:
179-
needs:
180-
- test_rust
181-
- build_lin
182-
- build_mac
183-
- build_win
184-
if: always()
185-
runs-on: ubuntu-latest
186-
steps:
187-
- name: Check failure
188-
if: |
189-
contains(needs.*.result, 'failure') ||
190-
contains(needs.*.result, 'cancelled')
191-
run: exit 1
192-
- name: Success
193-
run: echo Success!
19+
command: cd zarr-matlab, wkwBuild

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
# Rust specific
1515
Cargo.lock
1616

17-
matlab-zarr/rust/*/target
17+
zarr-matlab/rust/*/target
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)