Skip to content

Commit 4248118

Browse files
authored
Merge branch 'master' into 103-optimized-pull_request-and-issue
2 parents 715d128 + 1d79935 commit 4248118

31 files changed

+1853
-476
lines changed

.flake8

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[flake8]
2+
max-line-length = 120
3+
exclude = .git,__pycache__,docs
4+
statistics = True

.github/workflows/large-tests.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Large Tests
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
7+
jobs:
8+
token-usage-unit_test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Cache pip
14+
uses: actions/cache@v3
15+
with:
16+
path: ~/.cache/pip
17+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
18+
restore-keys: |
19+
${{ runner.os }}-pip-
20+
21+
- name: Install dependencies
22+
run: pip install -r requirements.txt
23+
24+
- name: Run test
25+
run: python3 test_token_usage.py --tt1 ${{ secrets.TEST_TOKEN_GITHUB }} --tt2 ${{ secrets.SECOND_TEST_TOKEN_GITHUB }} --repo moevm/github_repo_commitment_calc --out out.csv

.github/workflows/linter.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Linter
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
linter:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.x'
20+
21+
- name: Install flake8
22+
run: pip install flake8
23+
24+
- name: Run flake8
25+
run: flake8 .

.github/workflows/smoke-tests.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Smoke Tests
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
smoke-test:
11+
strategy:
12+
matrix:
13+
args:
14+
- "--invites"
15+
- "--commits"
16+
- "--pull_requests"
17+
- "--issues"
18+
- "--wikis"
19+
- "--contributors"
20+
- "--workflow_runs"
21+
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Cache pip
28+
uses: actions/cache@v3
29+
with:
30+
path: ~/.cache/pip
31+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
32+
restore-keys: |
33+
${{ runner.os }}-pip-
34+
35+
- name: Install dependencies
36+
run: pip install -r requirements.txt
37+
38+
- name: Create list.txt
39+
run: echo "thehighestmath/SummerPractice" > list.txt
40+
41+
- name: Run test
42+
run: |
43+
python3 main.py ${{ matrix.args }} --token ${{ secrets.TEST_TOKEN_GITHUB }} --list list.txt --out out.csv --branch master
44+
45+
- name: Check if out.csv exists
46+
run: ls out.csv
47+
48+
- name: Fail if out.csv does not exist
49+
if: failure()
50+
run: exit 1
51+
52+
- name: Show out.csv
53+
run: cat out.csv

.github/workflows/tests.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
venv/
2+
__pycache__
3+
list.txt
4+
tokens.txt
5+
out.csv

75-CreatedDocker/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Инструкция по разворачиванию Forgejo с использованием Docker
2+
Чтобы запустить в Docker контейнере Forgejo необходимо выполнить команду:
3+
```docker-compose up -d```
4+
5+
На localhost:3000 открывается Forgejo, необходимо пройти регистрацию и создать репозиторий.
6+
7+
Для подключения простейшего клиента к данному localhost необходимо передать ему ссылку на репозиторий и API токен.
8+
9+
Получить токен можно через "Settings" -> "Generate Token":
10+
![](forgejo0.png)
11+
![](forgejo1.png)
12+
13+
14+
Далее необходимо отредактировать файл `pyforgejo/.env`, и изменить `API_TOKEN`, `BASE_URL`, `REPO_OWNER` и `REPO_NAME`.
15+
16+
Например:
17+
```
18+
API_TOKEN=b3b55b3a469171bfe2105863332e23d89523d8af
19+
BASE_URL=http://localhost:3000
20+
REPO_OWNER=cyb3rc001
21+
REPO_NAME=test123
22+
```
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: '3'
2+
3+
services:
4+
forgejo:
5+
image: codeberg.org/forgejo/forgejo:1.18
6+
container_name: forgejo
7+
environment:
8+
- USER_UID=1000
9+
- USER_GID=1000
10+
volumes:
11+
- ./forgejo-data:/data
12+
ports:
13+
- "3000:3000"
14+
- "2222:22"
15+
restart: unless-stopped

75-CreatedDocker/forgejo0.png

63.1 KB
Loading

75-CreatedDocker/forgejo1.png

103 KB
Loading

0 commit comments

Comments
 (0)