Skip to content

Commit

Permalink
merge lock file
Browse files Browse the repository at this point in the history
  • Loading branch information
zain-sohail committed Oct 26, 2023
2 parents 78e28f4 + c137756 commit f899127
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 4 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: pytest

# Triggers the workflow on push for all branches
on: [push]

jobs:
pytest:
runs-on: ubuntu-latest
steps:
# Check out repo and set up Python
- name: Check out the repository
uses: actions/checkout@v4
with:
lfs: true

# Use cached python and dependencies, install poetry
- name: "Setup Python, Poetry and Dependencies"
uses: packetcoders/action-setup-cache-python-poetry@main
with:
python-version: 3.8
poetry-version: 1.2.2

# Run pytest with coverage report and upload results to coveralls
- name: Run tests on python 3.8
run: |
poetry run pytest --cov --cov-report xml:cobertura.xml --full-trace --show-capture=no -sv -n auto tests/
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: ./cobertura.xml
36 changes: 36 additions & 0 deletions .github/workflows/update_requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: update docs/requirements.txt for readthedocs

on:
# Triggers the workflow on push but only for the main branch
# and only for changes to the poetry.lock file
push:
branches: [ main ]
paths: [poetry.lock]

jobs:
pytest:
runs-on: ubuntu-latest
steps:
# Check out repo and set up Python
- name: Check out the repository
uses: actions/checkout@v4
with:
lfs: true

# Use cached python and dependencies, install poetry
- name: "Setup Python, Poetry and Dependencies"
uses: packetcoders/action-setup-cache-python-poetry@main
with:
python-version: 3.8
poetry-version: 1.2.2

# Generates and commits a requirements.txt used by readthedocs
- name: Export requirements.txt
run: poetry export --without-hashes --format=requirements.txt -o docs/requirements.txt -E docs -E notebook

- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: 'Updating requirements for docs'
add: 'docs/requirements.txt'
4 changes: 0 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/test_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@ def test_compute():
metadata["user0"]["email"] = "email"
# NXinstrument
metadata["instrument"] = {}
metadata["instrument"] = {}
# analyzer
metadata["instrument"]["analyzer"] = {}
metadata["instrument"]["analyzer"]["energy_resolution"] = 110.0
Expand Down

0 comments on commit f899127

Please sign in to comment.