diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..5c2c2d8a --- /dev/null +++ b/.github/workflows/main.yml @@ -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 diff --git a/environment.yml b/environment.yml new file mode 100644 index 00000000..bf1db968 --- /dev/null +++ b/environment.yml @@ -0,0 +1,6 @@ +name: regolith +channels: + - conda-forge +dependencies: + - python=3 + - pip