Skip to content

Commit d563ea5

Browse files
authored
Merge pull request #59 from chloeann95/issue51
Add GH actions for CI
2 parents c72f4f0 + 464ff3a commit d563ea5

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

.github/workflows/main.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
9+
10+
jobs:
11+
miniconda:
12+
name: Miniconda ${{ matrix.os }}
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: ["ubuntu-latest"]
17+
steps:
18+
- name: check out diffpy.pdfmorph
19+
uses: actions/checkout@v3
20+
with:
21+
repository: diffpy/diffpy.pdfmorph
22+
# for bookkeeping have diffpy.pdfmorph at the same level as everything else in the
23+
# directory tree
24+
path: .
25+
26+
- name: initialize miniconda
27+
# this uses a marketplace action that sets up miniconda in a way that makes
28+
# it easier to use. I tried setting it up without this and it was a pain
29+
uses: conda-incubator/setup-miniconda@v2
30+
with:
31+
activate-environment: test
32+
# environment.yml file is needed by this action. Because I don't want
33+
# maintain this but rather maintain the requirements files it just has
34+
# basic things in it like conda and pip
35+
environment-file: ./environment.yml
36+
python-version: 3
37+
auto-activate-base: false
38+
39+
- name: install pdfmorph requirements
40+
shell: bash -l {0}
41+
run: |
42+
conda config --set always_yes yes --set changeps1 no
43+
conda config --add channels conda-forge
44+
conda install --file requirements/run.txt
45+
pip install .
46+
47+
- name: Validate pdfmorph
48+
shell: bash -l {0}
49+
run: |
50+
cd diffpy.pdfmorph/diffpy/pdfmorph
51+
conda activate test
52+
cd ./diffpy/pdfmorph
53+
pytest tests

environment.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name: regolith
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python=3
6+
- pip

0 commit comments

Comments
 (0)