-
Notifications
You must be signed in to change notification settings - Fork 19
73 lines (62 loc) · 2.27 KB
/
build-and-test.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
70
71
72
73
name: build-and-test
run-name: ${{ github.actor }} is building "${{ github.ref_name }}"
on: [push]
env:
CIBW_ARCHS_LINUX: auto
CIBW_ARCHS_MACOS: x86_64 universal2
CIBW_BEFORE_BUILD: pip install cython
CIBW_SKIP: pp* cp27-* *_i686 *-win32 *musllinux*
CIBW_TEST_COMMAND: python -m amplpy.tests
CIBW_TEST_REQUIRES: --index-url https://pypi.ampl.com --extra-index-url https://pypi.org/simple ampl_module_base ampl_module_highs pandas numpy
jobs:
build_native:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2022, macos-latest]
steps:
- uses: actions/checkout@v3
- name: Download libampl
run: python3 dev/updatelib.py
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_LINUX: ${{ env.CIBW_ARCHS_LINUX }}
CIBW_ARCHS_MACOS: ${{ env.CIBW_ARCHS_MACOS }}
CIBW_BEFORE_BUILD: ${{ env.CIBW_BEFORE_BUILD }}
CIBW_SKIP: ${{ env.CIBW_SKIP }}
CIBW_TEST_COMMAND: ${{ env.CIBW_TEST_COMMAND }}
CIBW_TEST_REQUIRES: ${{ env.CIBW_TEST_REQUIRES }}
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
build_with_qemu:
#if: github.ref == 'refs/heads/release'
name: Build ${{ matrix.build }} wheels for ${{ matrix.arch }}
#needs: build_native
strategy:
matrix:
arch: [aarch64, ppc64le]
build: [cp36-*, cp37-*, cp38-*, cp39-*, cp310-*, cp311-*, cp312-*]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Download libampl
run: python3 dev/updatelib.py
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_ARCHS_MACOS: ${{ env.CIBW_ARCHS_MACOS }}
CIBW_BUILD: ${{ matrix.build }}
CIBW_SKIP: ${{ env.CIBW_SKIP }}
CIBW_TEST_COMMAND: ${{ env.CIBW_TEST_COMMAND }}
CIBW_TEST_REQUIRES: --index-url https://pypi.ampl.com --extra-index-url https://pypi.org/simple ampl_module_base
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl