-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add one master CI which builds, tests and deploys (#231)
* Add one master CI which builds, tests and deploys * Change needs order * Fix matrix syntax * Change flag to 17 from 11 * Don't error if can't find * Change wilcard pattern * Download store output * v3 * Check working directory * Run ls on right section * Switch to lowercase * Run uname to see output * Check OS output * Change back the extension * Remove the test step * Remove ls step * Don't specify path to library * Don't fail fast * Use add_dll_directory * Fix fail fast * Revert "Use add_dll_directory" This reverts commit caf8cbb. * Revert "Revert "Use add_dll_directory"" This reverts commit 1b2569d. * Adjust DLL directory and specify path manually * Fix DLL path * Hardcode the path 😢 * Build windows binary * Test adding windows binary to CI * Fix job * Don't download * Fix CI tabs * Removed needs * Use old binary * Undo comments * Remove the DLL * Remove the flags * Check cross-compiling on Windows * Install dependencies * Compile on windows too * Remove apt install * Cross compile Windows on Linux * Reduce jobs from 10 to 5 * Set environment variable * Selectively install dependency * SImplify if * Bump codecov * Only install mingw on certain item * Forgot matrix. * Add windows cross compile to name * Wrap the if statements * Try `if: true` * Fix whitespace * Update first * Try templating the name * Revert "Try templating the name" This reverts commit 21b8662. * Fail fast == true * Remove whitespace * Change indent
- Loading branch information
1 parent
1d09619
commit c9c413f
Showing
10 changed files
with
158 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
name: Build Wheels, Test & Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
paths-ignore: | ||
- "**.md" | ||
- "**.rst" | ||
|
||
jobs: | ||
build_wheels: | ||
name: | | ||
Build wheels on ${{ matrix.os }} with | ||
windows_cross_compile=${{ matrix.windows_cross_compile }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [macos-latest, ubuntu-latest] | ||
windows_cross_compile: [false, true] | ||
exclude: | ||
- os: macos-latest | ||
windows_cross_compile: true | ||
|
||
steps: | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y mingw-w64 | ||
if: matrix.windows_cross_compile | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Build wheels | ||
run: bash build.sh | ||
env: | ||
WINDOWS_CROSS_COMPILE: ${{ matrix.windows_cross_compile }} | ||
|
||
- name: Upload artefacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: artefacts | ||
path: | | ||
btrack/libs/* | ||
if-no-files-found: error | ||
|
||
test: | ||
needs: build_wheels | ||
name: ${{ matrix.os }} py${{ matrix.python-version }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10"] | ||
os: [ubuntu-latest] | ||
# Include one windows and macos run | ||
include: | ||
- os: macos-latest | ||
python-version: "3.10" | ||
- os: windows-latest | ||
python-version: "3.10" | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Download artefacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: artefacts | ||
path: btrack/libs | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
cache: "pip" | ||
cache-dependency-path: "pyproject.toml" | ||
|
||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
auto-update-conda: true | ||
python-version: "3.10" | ||
|
||
# note: if you need dependencies from conda, considering using | ||
# setup-miniconda: https://github.com/conda-incubator/setup-miniconda | ||
# and | ||
# tox-conda: https://github.com/tox-dev/tox-conda | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install "tox<4" tox-gh-actions tox-conda | ||
- name: Test with tox | ||
run: tox | ||
|
||
- name: Coverage | ||
uses: codecov/codecov-action@v3 | ||
|
||
deploy: | ||
needs: test | ||
runs-on: "ubuntu-latest" | ||
if: | | ||
github.repository == 'quantumjot/btrack' | ||
&& github.event_name == 'push' | ||
&& startsWith(github.ref, 'refs/tags') | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v3 | ||
|
||
- name: Download artefacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: artefacts | ||
path: btrack/libs | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
cache: "pip" | ||
cache-dependency-path: "pyproject.toml" | ||
|
||
- name: Install build dependencies | ||
run: python -m pip install build wheel | ||
|
||
- name: Build distributions | ||
shell: bash -l {0} | ||
run: python -m build | ||
|
||
- name: Publish package to PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_PASSWORD }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: checks | ||
name: Linting | ||
|
||
on: [push, pull_request] | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters