|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + - CI |
| 8 | + pull_request: |
| 9 | + workflow_dispatch: |
| 10 | + |
| 11 | +jobs: |
| 12 | + miniconda: |
| 13 | + name: Miniconda ${{ matrix.os }} |
| 14 | + runs-on: ${{ matrix.os }} |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + os: ["ubuntu-latest"] |
| 18 | + steps: |
| 19 | + - name: check out diffpy.nmf_mapping |
| 20 | + uses: actions/checkout@v3 |
| 21 | + with: |
| 22 | + repository: diffpy/diffpy.nmf_mapping |
| 23 | + path: . |
| 24 | + fetch-depth: 0 # avoid shallow clone with no tags |
| 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 diffpy.nmf_mapping 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 activate test |
| 45 | + conda install --file requirements/run.txt |
| 46 | + conda install --file requirements/test.txt |
| 47 | + pip install . |
| 48 | +
|
| 49 | + - name: Validate diffpy.nmf_mapping |
| 50 | + shell: bash -l {0} |
| 51 | + run: | |
| 52 | + conda activate test |
| 53 | + coverage run -m pytest -vv -s |
| 54 | + coverage report -m |
| 55 | + codecov |
| 56 | +
|
| 57 | + - name: Upload coverage to Codecov |
| 58 | + uses: codecov/codecov-action@v4 |
| 59 | + env: |
| 60 | + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
0 commit comments