Skip to content

Workflow file for this run

name: install-and-test-workflow
on: [push]
permissions:
contents: read
env:
# using uv pip requires an existing venv by default
# allows installating packages in the system
UV_SYSTEM_PYTHON: true
jobs:
install-and-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python_version: ["3.12", "3.11", "3.10", "3.9"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{matrix.python_version}}
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python_version}}
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
# uses: astral-sh/setup-uv@v3
- name: Install dependencies
run: |
uv pip install -e '.[dev]'
- name: Test with pytest
run: |
pytest
# python -m coverage run -m pytest -sv
# - name: Submit to coveralls
# continue-on-error: true
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# coveralls --service=github
# - name: Test with nomad
# run: |
# python -m nomad.cli parse tests/data/example.archive.json
build-and-install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Build the package
run: |
uv build --sdist
- name: Install the package
run: |
uv pip install dist/*.tar.gz --index-url https://gitlab.mpcdf.mpg.de/api/v4/projects/2187/packages/pypi/simple
# - name: Test with nomad
# run: |
# python -m nomad.cli parse tests/data/example.archive.json
ruff-linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
with:
args: "check ."
# to enable auto-formatting check, uncomment the following lines below
ruff-formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
with:
args: "format . --check"