diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ba7667d..448b936 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,25 +1,45 @@ name: Test -on: [push, pull_request] +on: + push: + branches: + - mas + pull_request: + workflow_dispatch: jobs: - main: - runs-on: ubuntu-latest - defaults: - run: - shell: bash -l {0} + miniconda: + name: Miniconda ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: ["ubuntu-latest"] steps: - - uses: actions/checkout@v2 - - - uses: conda-incubator/setup-miniconda@v2 + - name: check out xpdtools + uses: actions/checkout@v3 + with: + repository: xpdacq/xpdtools + # for bookkeeping have diffpy.snmf 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 - channels: nsls2forge,conda-forge + # 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 auto-update-conda: true + environment-file: ./environment.yml + auto-activate-base: false - name: install requirements run: >- - conda install --file requirements.txt --file requirements-dev.txt + conda install --file requirements.txt + conda install --file requirements-dev.txt - name: install the package run: python -m pip install . --no-deps @@ -34,3 +54,6 @@ jobs: - name: check the code style run: flake8 + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..a8b125d --- /dev/null +++ b/environment.yml @@ -0,0 +1,6 @@ +name: xpdtools +channels: + - conda-forge +dependencies: + - python=3 + - pip diff --git a/requirements-dev.txt b/requirements-dev.txt index fe5ca71..2a71626 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,5 @@ flake8 -pytest==5.4 -xpdsim +pytest nose codecov coverage