Skip to content

Commit d9f31ff

Browse files
committed
Added Ahmed changes to the pipeline for comment on pr from coverage
1 parent a83fbdd commit d9f31ff

File tree

1 file changed

+42
-35
lines changed

1 file changed

+42
-35
lines changed

.github/workflows/actions.yaml

Lines changed: 42 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,54 @@
11
name: install-and-test
22
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+
312
jobs:
413
install-and-test:
514
runs-on: ubuntu-latest
615
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
2936
build-and-install:
3037
runs-on: ubuntu-latest
3138
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
4552
ruff-linting:
4653
runs-on: ubuntu-latest
4754
steps:

0 commit comments

Comments
 (0)