-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (75 loc) · 2.22 KB
/
actions.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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"