Skip to content

Commit

Permalink
Merge pull request #99 from BCDA-APS/68-CI-workflows
Browse files Browse the repository at this point in the history
combine CI workflows
  • Loading branch information
prjemian committed Aug 18, 2022
2 parents f906c99 + 0a544b7 commit 36a53df
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 52 deletions.
File renamed without changes.
File renamed without changes.
89 changes: 89 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Unit Tests

on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch: # allow manual triggering

defaults:
run:
shell: bash

jobs:

lint:
name: Code style
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Run flake8
run: |
flake8
# black
test-matrix:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
needs: lint
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
max-parallel: 5

steps:
- uses: actions/checkout@v2

- name: Create Python ${{ matrix.python-version }} environment
uses: mamba-org/provision-with-micromamba@main
# use main branch to enable choice of channel-priority
with:
cache-env: true
cache-env-key: env-key-${{ matrix.python-version }}
channel-priority: flexible
environment-file: environment.yml
environment-name: anaconda-test-env-py-${{ matrix.python-version }}

- name: Initial diagnostics
run: |
micromamba info
micromamba list
conda config --show-sources
conda config --show
micromamba env list
printenv | sort
- name: micromamba env & list
run: |
micromamba env list
micromamba list
- name: Run tests with pytest & coverage
shell: bash -l {0}
run: |
python -m pip install pytest coverage coveralls
coverage run --concurrency=thread --parallel-mode -m pytest -vvv .
coverage combine
coverage report --precision 3
- name: Upload to coveralls
# https://github.com/TheKevJames/coveralls-python
shell: bash -l {0}
run: |
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![tag](https://img.shields.io/github/tag/BCDA-APS/adl2pydm.svg)](https://github.com/BCDA-APS/adl2pydm/tags)
[![Python version](https://img.shields.io/pypi/pyversions/adl2pydm.svg)](https://pypi.python.org/pypi/adl2pydm)
[![PyPi](https://img.shields.io/pypi/v/adl2pydm.svg)](https://pypi.python.org/pypi/adl2pydm)
[![aps-anl-tag](https://img.shields.io/conda/vn/aps-anl-tag/adl2pydm)](https://anaconda.org/aps-anl-tag/adl2pydm)
[![conda-forge](https://img.shields.io/conda/vn/conda-forge/adl2pydm)](https://anaconda.org/conda-forge/adl2pydm)

[![license: ANL](https://img.shields.io/badge/license-ANL-brightgreen)](LICENSE.txt)
![Unit Tests](https://github.com/BCDA-APS/adl2pydm/workflows/Unit%20Tests/badge.svg)
Expand Down
1 change: 1 addition & 0 deletions adl2pydm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Astronomy",
"Topic :: Scientific/Engineering :: Bio-Informatics",
Expand Down
51 changes: 0 additions & 51 deletions publish.sh

This file was deleted.

0 comments on commit 36a53df

Please sign in to comment.