Use ref_name if head_ref is not present (#348) #17
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: NOMAD dependencies compatibility | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
# Run workflow only when there are changes in pyproject.toml or dev-requirements.txt | |
paths: | |
- 'pyproject.toml' | |
- 'dev-requirements.txt' | |
jobs: | |
validate_dependencies: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout pynxtools | |
uses: actions/checkout@v2 | |
- name: Checkout NOMAD from GitLab | |
run: | | |
git clone --depth 1 --branch develop --recurse-submodules https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-FAIR.git nomad | |
git submodule update --init --recursive --depth 1 | |
- name: Replace pynxtools dependency in NOMAD pyproject.toml | |
working-directory: ./nomad | |
run: | | |
sed -i 's|pynxtools\[convert\]==[0-9]\+\(\.[0-9]\+\)\{0,2\}|pynxtools\[convert\]@git+https://github.com/FAIRmat-NFDI/pynxtools.git@${{ github.head_ref || github.ref_name }} |' pyproject.toml | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: Install uv | |
run: | | |
curl -LsSf https://astral.sh/uv/install.sh | sh | |
- name: Generate (dev-)requirements.txt from modified pyproject.toml | |
working-directory: ./nomad | |
run: | | |
uv pip compile -p 3.9 --annotation-style=line --extra=infrastructure --extra=parsing --output-file=requirements.txt dependencies/nomad-dos-fingerprints/pyproject.toml dependencies/parsers/eelsdb/pyproject.toml pyproject.toml | |
uv pip compile -p 3.9 --annotation-style=line --extra=dev --extra=infrastructure --extra=parsing --output-file=requirements-dev.txt requirements.txt pyproject.toml | |
- name: Install NOMAD dependencies with pynxtools from current branch | |
working-directory: ./nomad | |
run: | | |
uv pip install --system -r requirements.txt | |
uv pip install --system -r requirements-dev.txt | |
env: | |
PYTHONPATH: "" # Ensure no pre-installed packages interfere with the test |