Skip to content

Commit 169fd6b

Browse files
committed
add: git work flow
1 parent 9cefcda commit 169fd6b

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Python application
5+
6+
on:
7+
push:
8+
branches: [ "main", "dev" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
workflow_dispatch:
12+
13+
14+
jobs:
15+
build:
16+
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Set up Python 3.10
22+
uses: actions/setup-python@v3
23+
with:
24+
python-version: "3.10"
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install flake8 pytest
29+
if [ -f requirements/runtime.txt ]; then pip install -r requirements/runtime.txt; fi
30+
pip install -e .
31+
- name: Lint with flake8
32+
run: |
33+
# stop the build if there are Python syntax errors or undefined names
34+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
37+
- name: Integration Test(local plaintext)
38+
run: |
39+
python -m dingo.run.cli --input_path test/data/test_local_plaintext.txt --dataset local -e default --data_format plaintext
40+
- name: Integration Test(local json)
41+
run: |
42+
python -m dingo.run.cli --input_path test/data/test_local_json.json --dataset local -e default --data_format json --column_content prediction
43+
- name: Integration Test(local jsonl)
44+
run: |
45+
python -m dingo.run.cli --input_path test/data/test_local_jsonl.jsonl --dataset local -e default --data_format jsonl --column_content content
46+
- name: Integration Test(local listjson)
47+
run: |
48+
python -m dingo.run.cli --input_path test/data/test_local_listjson.json --dataset local -e default --data_format listjson --column_content output
49+
- name: Integration Test(huggingface plaintext)
50+
run: |
51+
python -m dingo.run.cli --input_path chupei/format-text -e default --data_format plaintext --column_content text
52+
- name: Integration Test(huggingface json)
53+
run: |
54+
python -m dingo.run.cli --input_path chupei/format-json -e default --data_format json --column_content prediction --column_prompt origin_prompt
55+
- name: Integration Test(huggingface jsonl)
56+
run: |
57+
python -m dingo.run.cli --input_path chupei/format-jsonl -e default --data_format jsonl --column_content content
58+
- name: Integration Test(huggingface listjson)
59+
run: |
60+
python -m dingo.run.cli --input_path chupei/format-listjson -e default --data_format listjson --column_content output --column_prompt instruction
61+
- name: Integration Test(custom config)
62+
run: |
63+
python -m dingo.run.cli --input_path test/data/test_local_json.json --dataset local -e test --data_format json --column_content prediction --custom_config test/config/config_rule.json --log_level=DEBUG

0 commit comments

Comments
 (0)