|
1 | | -name: Build Python module |
| 1 | +name: MATLAB Tests |
2 | 2 |
|
| 3 | +# Controls when the action will run. |
3 | 4 | on: [push] |
4 | 5 |
|
5 | 6 | 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 |
62 | 9 |
|
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"] |
69 | 10 | steps: |
70 | 11 | - 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 |
101 | 12 |
|
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 |
170 | 15 |
|
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 |
173 | 18 | 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 |
0 commit comments