updating gh workflow to bring it up to current patterns #11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
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 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 | |
# 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 | |
- name: install the package | |
run: python -m pip install . --no-deps | |
- name: run the tests and check for test coverage | |
run: coverage run -m pytest | |
- name: generate the test coverage report and upload it to codecov | |
run: | | |
coverage report -m | |
codecov | |
- name: check the code style | |
run: flake8 | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 |