Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Attempting to fix build pipeline Issue #57 #58

Merged
merged 2 commits into from
May 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 13 additions & 39 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,19 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.9
cache: 'pipenv'

- name: Cache conda
id: cache-conda
uses: actions/cache@v2
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('environment.yml') }}
- name: Install pipenv
run: pip install pipenv

- name: Setup conda, install dependencies
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: anaconda-client-env
channel-priority: strict
environment-file: environment.yml
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Install dependencies
run: pipenv install --ignore-pipfile

- name: Test with pytest, generate coverage report
run: |
$CONDA/envs/anaconda-client-env/bin/pytest -s --cov=./rcwa --cov-report xml --cov-config=.coveragerc

- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
$CONDA/envs/anaconda-client-env/bin/flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
$CONDA/envs/anaconda-client-env/bin/flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
run: pipenv run test

- name: Upload coverage report to codecov
uses: codecov/codecov-action@v1
Expand All @@ -64,8 +43,7 @@ jobs:
verbose: true

- name: Build python package
run:
$CONDA/bin/python setup.py sdist bdist_wheel
run: pipenv run build

- name: Deploy to test PyPi
uses: pypa/gh-action-pypi-publish@master
Expand All @@ -77,15 +55,11 @@ jobs:

- name: Download and install from TestPyPi
run:
$CONDA/envs/anaconda-client-env/bin/pip install --index-url https://test.pypi.org/simple --extra-index-url https://pypi.org/simple rcwa;

- name: Show where rcwa is located
run:
$CONDA/envs/anaconda-client-env/bin/pip show rcwa;
pip install --index-url https://test.pypi.org/simple --extra-index-url https://pypi.org/simple rcwa;

- name: Run testPyPi test suite
run:
$CONDA/envs/anaconda-client-env/bin/pytest $CONDA/envs/anaconda-client-env/lib/python3.9/site-packages/rcwa/
python3 -m rcwa.test.pytest_runner

- name: Deploy to PyPi
uses: pypa/gh-action-pypi-publish@master
Expand All @@ -97,9 +71,9 @@ jobs:

- name: Download aand install from PyPi
run:
$CONDA/envs/anaconda-client-env/bin/pip uninstall -y rcwa;
$CONDA/envs/anaconda-client-env/bin/pip install rcwa;
pip uninstall -y rcwa;
pip install rcwa;

- name: Run PyPi test suite
run:
$CONDA/envs/anaconda-client-env/bin/pytest $CONDA/envs/anaconda-client-env/lib/python3.9/site-packages/rcwa/
python3 -m rcwa.test.pytest_runner
32 changes: 32 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
coverage = "*"
coveralls = "*"
numpy = "*"
pandas = "*"
scipy = "*"
sphinx = "*"
sphinx-rtd-theme = "*"
setuptools = "*"
wheel = "*"
pyyaml = "*"
flake8 = "*"
pytest = "*"
pytest-cov = "*"
autograd = "*"
matplotlib = "*"
progressbar = "*"

[dev-packages]
pipenv = "*"

[requires]
python_version = "3.9"

[scripts]
test = "python3 -m pytest -s --cov=./rcwa --cov-report xml --cov-config=.coveragerc"
build = "python3 setup.py sdist bdist_wheel"
Loading