Skip to content

Commit cf90e1a

Browse files
committed
add github action
1 parent d039673 commit cf90e1a

File tree

4 files changed

+46
-5
lines changed

4 files changed

+46
-5
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: my check
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Set up Python
13+
uses: actions/setup-python@v5
14+
with:
15+
python-version: '3.12'
16+
# make depends on uv
17+
- name: Install dependencies
18+
run: |
19+
pip install uv
20+
make install
21+
- name: Run linter and pytest
22+
run: |
23+
make check
24+
- name: Test & publish code coverage
25+
uses: paambaati/[email protected]
26+
if: github.ref_name == 'main'
27+
env:
28+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
29+
with:
30+
coverageCommand: make test-coverage
31+
debug: true

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,13 @@ install:
77
build:
88
uv build
99

10+
test-coverage:
11+
uv run pytest --cov=gendiff --cov-report xml
12+
1013
package-install:
1114
uv tool dist/*.whl
15+
16+
test:
17+
uv run pytest
18+
19+
check: test lint

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
### Hexlet tests and linter status:
2-
[![Actions Status](https://github.com/ttehasi/python-project-50/actions/workflows/hexlet-check.yml/badge.svg)](https://github.com/ttehasi/python-project-50/actions)
2+
[![Actions Status](https://github.com/ttehasi/python-project-50/actions/workflows/hexlet-check.yml/badge.svg)](https://github.com/ttehasi/python-project-50/actions)
3+
4+
<a href="https://codeclimate.com/github/ttehasi/python-project-50/maintainability"><img src="https://api.codeclimate.com/v1/badges/88675eaf4e4ca1e04a88/maintainability" /></a>
5+
6+
<a href="https://codeclimate.com/github/ttehasi/python-project-50/test_coverage"><img src="https://api.codeclimate.com/v1/badges/88675eaf4e4ca1e04a88/test_coverage" /></a>

gendiff/gen_diff.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ def open_f(path_to_file) -> dict:
77

88

99
def generate_diff(file1, file2):
10-
file1 = open_f(file1)
11-
file2 = open_f(file2)
12-
sorted_keys_f1 = sorted(list(file1))
13-
sorted_keys_f2 = sorted(list(file2))
10+
sorted_keys_f1 = sorted(list(open_f(file1)))
11+
sorted_keys_f2 = sorted(list(open_f(file2)))
1412
res = '''{
1513
'''
1614
for i in sorted_keys_f1:

0 commit comments

Comments
 (0)