Skip to content

Commit

Permalink
Add tox
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey committed Jul 28, 2023
1 parent a8c9ff1 commit 28f939b
Showing 1 changed file with 77 additions and 25 deletions.
102 changes: 77 additions & 25 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,60 @@
name: Build

on: [workflow_dispatch]
on:
push:
# workflow_dispatch:
pull_request:
branches:
- master
release:
types:
- created
schedule:
- cron: "0 7 * * 1"


jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: cp${{ matrix.python }}
- name: Install tox
run: |
pip install --upgrade pip
pip install tox
- name: Run tox
run: |
tox -e py{{ matrix.python | replace(".", "") }}
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install tox
run: |
pip install --upgrade pip
pip install tox
- name: Run tox for lint and docs
run: |
tox -e flake8,docs
- uses: actions/upload-artifact@v3
with:
name: docs
path: ./docs/_build
# TODO:
# publish this if merged to master or a tag
build_wheels:
needs:
- test
- lint
name: Build wheels on ${{ matrix.buildplat[0] }} / ${{ matrix.buildplat[1] }} for ${{ matrix.python }}
runs-on: ${{ matrix.buildplat[0] }}
strategy:
Expand Down Expand Up @@ -38,27 +87,30 @@ jobs:
name: ${{ matrix.python }}-${{ startsWith(matrix.buildplat[1], 'macosx') && 'macosx' || matrix.buildplat[1] }}
path: ./wheelhouse/*.whl

publish:
runs-on: ubuntu-latest
needs: build_wheels
steps:
- uses: actions/setup-python@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- uses: actions/download-artifact@v2
with:
path: artifacts
- name: Publish artifacts
env:
TWINE_USERNAME: secrets.TWINE_USERNAME
TWINE_PASSWORD: secrets.TWINE_PASSWORD
TWINE_REPOSITORY_URL: secrets.TWINE_REPOSITORY_URL
shell: bash
working-directory: artifacts
run: |
ls -alR
for i in $( ls ); do
cat $i/$ARTIFACT
done
# # docs-deploy
# publish:
# runs-on: ubuntu-latest
# needs:
# - build_wheels
# # - docker
# steps:
# - uses: actions/setup-python@v2
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install setuptools wheel twine
# - uses: actions/download-artifact@v2
# with:
# path: artifacts
# - name: Publish artifacts
# env:
# TWINE_USERNAME: secrets.TWINE_USERNAME
# TWINE_PASSWORD: secrets.TWINE_PASSWORD
# TWINE_REPOSITORY_URL: secrets.TWINE_REPOSITORY_URL
# shell: bash
# working-directory: artifacts
# run: |
# ls -alR
# for i in $( ls ); do
# cat $i/$ARTIFACT
# done

0 comments on commit 28f939b

Please sign in to comment.