|
1 | 1 | name: install-and-test
|
2 | 2 | on: [push]
|
| 3 | + |
| 4 | +# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs |
| 5 | +# `contents` is for permission to the contents of the repository. |
| 6 | +# `pull-requests` is for permission to pull request |
| 7 | +permissions: |
| 8 | + contents: write |
| 9 | + checks: write |
| 10 | + pull-requests: write |
| 11 | + |
3 | 12 | jobs:
|
4 | 13 | install-and-test:
|
5 | 14 | runs-on: ubuntu-latest
|
6 | 15 | steps:
|
7 |
| - - uses: actions/checkout@v3 |
8 |
| - - name: Set up Python 3.9 |
9 |
| - uses: actions/setup-python@v2 |
10 |
| - with: |
11 |
| - python-version: 3.9 |
12 |
| - - name: Install dependencies |
13 |
| - run: | |
14 |
| - pip install --upgrade pip |
15 |
| - pip install '.[dev]' --index-url https://gitlab.mpcdf.mpg.de/api/v4/projects/2187/packages/pypi/simple |
16 |
| - pip install coverage coveralls |
17 |
| - - name: mypy |
18 |
| - run: | |
19 |
| - python -m mypy --ignore-missing-imports --follow-imports=silent --no-strict-optional src/nomad_simulations tests |
20 |
| - - name: Test with pytest |
21 |
| - run: | |
22 |
| - python -m coverage run -m pytest -sv tests |
23 |
| - - name: Submit to coveralls |
24 |
| - continue-on-error: true |
25 |
| - env: |
26 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
27 |
| - run: | |
28 |
| - coveralls --service=github |
| 16 | + - uses: actions/checkout@v3 |
| 17 | + - name: Set up Python 3.9 |
| 18 | + uses: actions/setup-python@v2 |
| 19 | + with: |
| 20 | + python-version: 3.9 |
| 21 | + - name: Install dependencies |
| 22 | + run: | |
| 23 | + pip install uv |
| 24 | + uv pip install -e '.[dev]' --index-url https://gitlab.mpcdf.mpg.de/api/v4/projects/2187/packages/pypi/simple --system |
| 25 | + - name: mypy |
| 26 | + run: | |
| 27 | + python -m mypy --ignore-missing-imports --follow-imports=silent --no-strict-optional src/nomad_simulations tests |
| 28 | + - name: Build coverage file |
| 29 | + run: | |
| 30 | + pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=src tests/ | tee pytest-coverage.txt |
| 31 | + - name: Pytest coverage comment |
| 32 | + uses: MishaKav/pytest-coverage-comment@main |
| 33 | + with: |
| 34 | + pytest-coverage-path: pytest-coverage.txt |
| 35 | + junitxml-path: pytest.xml |
29 | 36 | build-and-install:
|
30 | 37 | runs-on: ubuntu-latest
|
31 | 38 | steps:
|
32 |
| - - uses: actions/checkout@v3 |
33 |
| - - name: Set up Python 3.9 |
34 |
| - uses: actions/setup-python@v2 |
35 |
| - with: |
36 |
| - python-version: 3.9 |
37 |
| - - name: Build the package |
38 |
| - run: | |
39 |
| - pip install --upgrade pip |
40 |
| - pip install build |
41 |
| - python -m build --sdist |
42 |
| - - name: Install the package |
43 |
| - run: | |
44 |
| - pip install dist/*.tar.gz --index-url https://gitlab.mpcdf.mpg.de/api/v4/projects/2187/packages/pypi/simple |
| 39 | + - uses: actions/checkout@v3 |
| 40 | + - name: Set up Python 3.9 |
| 41 | + uses: actions/setup-python@v2 |
| 42 | + with: |
| 43 | + python-version: 3.9 |
| 44 | + - name: Build the package |
| 45 | + run: | |
| 46 | + pip install --upgrade pip |
| 47 | + pip install build |
| 48 | + python -m build --sdist |
| 49 | + - name: Install the package |
| 50 | + run: | |
| 51 | + pip install dist/*.tar.gz --index-url https://gitlab.mpcdf.mpg.de/api/v4/projects/2187/packages/pypi/simple |
45 | 52 | ruff-linting:
|
46 | 53 | runs-on: ubuntu-latest
|
47 | 54 | steps:
|
|
0 commit comments