Skip to content

Add GH actions for CI #59

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

Merged
merged 2 commits into from
Feb 27, 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
53 changes: 53 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
miniconda:
name: Miniconda ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest"]
steps:
- name: check out diffpy.pdfmorph
uses: actions/checkout@v3
with:
repository: diffpy/diffpy.pdfmorph
# for bookkeeping have diffpy.pdfmorph at the same level as everything else in the
# directory tree
path: .

- name: initialize miniconda
# this uses a marketplace action that sets up miniconda in a way that makes
# it easier to use. I tried setting it up without this and it was a pain
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test
# environment.yml file is needed by this action. Because I don't want
# maintain this but rather maintain the requirements files it just has
# basic things in it like conda and pip
environment-file: ./environment.yml
python-version: 3
auto-activate-base: false

- name: install pdfmorph requirements
shell: bash -l {0}
run: |
conda config --set always_yes yes --set changeps1 no
conda config --add channels conda-forge
conda install --file requirements/run.txt
pip install .

- name: Validate pdfmorph
shell: bash -l {0}
run: |
cd diffpy.pdfmorph/diffpy/pdfmorph
conda activate test
cd ./diffpy/pdfmorph
pytest tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we will need to insert here a line cd ./diffpy/pdfmorph before the pytest row.

6 changes: 6 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: regolith
channels:
- conda-forge
dependencies:
- python=3
- pip