Skip to content

Commit

Permalink
Break up actions into one that does linting and tests python build an…
Browse files Browse the repository at this point in the history
…d other that builds and publishes the wheel
  • Loading branch information
bruce-edelman committed Nov 15, 2023
1 parent a9461a8 commit 2d16fd1
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 20 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,36 +1,45 @@

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: diploshic
name: Build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
on: push

jobs:
build:

Build_Package:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
python-version: ${{ matrix.python-version }}
- name: Setup conda
uses: s-weigand/setup-conda@v1
with:
activate-conda: true
update-conda: true
python-version: ${{ matrix.python-version }}
conda-channels: conda-forge
- name: Install dependencies
run: |
conda install pip setuptools
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
- name: Install diploSHIC
run: |
pip install .
- name: List installed
run: |
pytest
conda list
12 changes: 9 additions & 3 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package
name: Publish

on: [push, pull_request]
on:
push:
branches:
- main
- master
tags:
- v*

jobs:
manylinux:
Build_Wheel:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down

0 comments on commit 2d16fd1

Please sign in to comment.