Skip to content

Commit 7bcf527

Browse files
authored
Merge pull request #589 from FAIRmat-NFDI/update-workflows
update CI/CD workflows
2 parents a18bca6 + 0d70836 commit 7bcf527

File tree

6 files changed

+31
-46
lines changed

6 files changed

+31
-46
lines changed

.github/workflows/build_docs.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ name: build_and_deploy_mkdocs
33
on:
44
push:
55
branches:
6-
- master # Triggers deployment on push to the main branch
7-
8-
env:
9-
UV_SYSTEM_PYTHON: true
6+
- master # Triggers deployment on push to the master branch
107

118
permissions:
129
contents: write
@@ -27,10 +24,10 @@ jobs:
2724
git config user.name github-actions[bot]
2825
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
2926
30-
- name: Set up Python
31-
uses: actions/setup-python@v5
27+
- name: Install uv and set the python version to 3.11
28+
uses: astral-sh/setup-uv@v5
3229
with:
33-
python-version: '3.x'
30+
python-version: 3.11
3431

3532
- name: Cache mkdocs-material environment
3633
uses: actions/cache@v3
@@ -42,7 +39,6 @@ jobs:
4239
4340
- name: Install Dependencies
4441
run: |
45-
curl -LsSf https://astral.sh/uv/install.sh | sh
4642
uv pip install --no-cache-dir ".[docs]"
4743
4844
- name: Build and Deploy

.github/workflows/nomad-requirements.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
# - 'dev-requirements.txt'
1414

1515
env:
16-
UV_SYSTEM_PYTHON: true
16+
python-version: 3.11
1717

1818
jobs:
1919
validate_dependencies:
@@ -28,26 +28,21 @@ jobs:
2828
git clone --depth 1 --branch develop --recurse-submodules https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-FAIR.git nomad
2929
git submodule update --init --recursive --depth 1
3030
31-
- name: Replace pynxtools dependency in NOMAD pyproject.toml
31+
- name: Add pynxtools dependency in NOMAD test_plugins.txt
3232
working-directory: ./nomad
3333
run: |
34-
sed -i 's|pynxtools\[convert\]==[0-9]\+\(\.[0-9]\+\)\+\([0-9]\)|pynxtools\[convert\]@git+https://github.com/FAIRmat-NFDI/pynxtools.git@${{ github.head_ref || github.ref_name }} |' default_plugins.txt
35-
- name: Set up Python
36-
uses: actions/setup-python@v5
34+
echo "" >> test_plugins.txt
35+
echo "pynxtools[convert]@git+https://github.com/FAIRmat-NFDI/pynxtools.git@${{ github.head_ref || github.ref_name }}" >> test_plugins.txt
36+
- name: Install uv and set the python version to ${{ env.python-version }}
37+
uses: astral-sh/setup-uv@v5
3738
with:
38-
python-version: '3.11'
39-
40-
- name: Install uv
41-
run: |
42-
curl -LsSf https://astral.sh/uv/install.sh | sh
43-
39+
python-version: ${{ env.python-version }}
4440
- name: Generate (dev-)requirements.txt from modified pyproject.toml
4541
working-directory: ./nomad
4642
run: |
47-
uv pip compile --universal -p 3.11 --annotation-style=line --extra=infrastructure --extra=parsing --output-file=requirements.txt pyproject.toml
48-
uv pip compile --universal -p 3.11 --annotation-style=line --extra=dev --extra=infrastructure --extra=parsing --output-file=requirements-dev.txt requirements.txt pyproject.toml
49-
uv pip compile --universal -p 3.11 --annotation-style=line --output-file=requirements-plugins.txt --unsafe-package nomad-lab -c requirements-dev.txt default_plugins.txt
50-
43+
uv pip compile --universal -p ${{ env.python-version }} --annotation-style=line --extra=infrastructure --extra=parsing --output-file=requirements.txt pyproject.toml
44+
uv pip compile --universal -p ${{ env.python-version }} --annotation-style=line --extra=dev --extra=infrastructure --extra=parsing --output-file=requirements-dev.txt requirements.txt pyproject.toml
45+
uv pip compile --universal -p ${{ env.python-version }} --annotation-style=line --output-file=requirements-plugins.txt --unsafe-package nomad-lab -c requirements-dev.txt test_plugins.txt
5146
- name: Install NOMAD dependencies with pynxtools from current branch
5247
working-directory: ./nomad
5348
run: |

.github/workflows/plugin_test.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
branches: [master]
1111

1212
env:
13-
UV_SYSTEM_PYTHON: true
13+
python-version: 3.11
1414

1515
jobs:
1616
pytest:
@@ -49,18 +49,17 @@ jobs:
4949
tests_to_run: tests/.
5050

5151
steps:
52-
- uses: actions/checkout@v3
52+
- uses: actions/checkout@v4
5353
with:
5454
fetch-depth: 0
5555
submodules: recursive
56-
- name: Set up Python 3.11
57-
uses: actions/setup-python@v5
56+
- name: Install uv and set the python version to ${{ env.python-version }}
57+
uses: astral-sh/setup-uv@v5
5858
with:
59-
python-version: 3.11
59+
python-version: ${{ env.python-version }}
6060
- name: Install dependencies
6161
run: |
62-
curl -LsSf https://astral.sh/uv/install.sh | sh
63-
uv pip install --system coverage coveralls
62+
uv pip install coverage coveralls
6463
- name: Install package
6564
run: |
6665
uv pip install ".[dev]"

.github/workflows/publish.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types: [published]
66

77
env:
8-
UV_SYSTEM_PYTHON: true
8+
python-version: 3.11
99

1010
jobs:
1111
deploy:
@@ -21,13 +21,12 @@ jobs:
2121
with:
2222
fetch-depth: 0
2323
submodules: recursive
24-
- name: Set up Python
25-
uses: actions/setup-python@v5
24+
- name: Install uv and set the python version to ${{ env.python-version }}
25+
uses: astral-sh/setup-uv@v5
2626
with:
27-
python-version: "3.x"
27+
python-version: ${{ env.python-version }}
2828
- name: Install dependencies
2929
run: |
30-
curl -LsSf https://astral.sh/uv/install.sh | sh
3130
uv pip install build
3231
- name: Git tag version
3332
id: git_tag_version

.github/workflows/pylint.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,24 @@ name: linting
33
on: [push]
44

55
env:
6-
UV_SYSTEM_PYTHON: true
6+
python-version: 3.11
77

88
jobs:
99
linting:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v4
13-
- name: Set up Python 3.10
14-
uses: actions/setup-python@v5
13+
- name: Install uv and set the python version to ${{ env.python-version }}
14+
uses: astral-sh/setup-uv@v5
1515
with:
16-
python-version: "3.10"
16+
python-version: ${{ env.python-version }}
1717
- name: Install dependencies
1818
run: |
1919
git submodule sync --recursive
2020
git submodule update --init --recursive --jobs=4
21-
curl -LsSf https://astral.sh/uv/install.sh | sh
22-
- name: Install package
21+
- name: Install package and dev requirements
2322
run: |
24-
uv pip install --no-deps .
25-
- name: Install dev requirements
26-
run: |
27-
uv pip install -r dev-requirements.txt
23+
uv pip install .[dev]
2824
- name: ruff check
2925
run: |
3026
ruff check src/pynxtools tests

.github/workflows/pytest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ jobs:
4848
env:
4949
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5050
run: |
51-
coveralls --service=github
51+
coveralls --service=github

0 commit comments

Comments
 (0)