From 18d96352bcd174f9ed11c6cf894ea35fe57e74e1 Mon Sep 17 00:00:00 2001 From: pheetah Date: Sun, 24 Dec 2023 16:41:14 +0300 Subject: [PATCH 1/9] feat: set up CI tests --- .github/pull_request.yml | 10 ++++++++++ requirements.txt | 6 +++++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .github/pull_request.yml diff --git a/.github/pull_request.yml b/.github/pull_request.yml new file mode 100644 index 0000000..bb24d70 --- /dev/null +++ b/.github/pull_request.yml @@ -0,0 +1,10 @@ +name: Pull Request Testing + +steps: +- uses: actions/checkout@v4 +- uses: actions/setup-python@v4 + with: + python-version: '3.11' + cache: 'pip' +- run: pip install -r requirements.txt +- run: pip test diff --git a/requirements.txt b/requirements.txt index ec8c694..c1209ab 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,6 @@ +# main code-tokenize==0.2.0 -pygraphviz==1.11 \ No newline at end of file +pygraphviz==1.11 +# test +pytest-cov==4.1.0 +pytest==7.4.3 \ No newline at end of file From 18697960eb1b1e9a10e525dc7f1bcbc010a0cc09 Mon Sep 17 00:00:00 2001 From: pheetah Date: Sun, 24 Dec 2023 16:42:37 +0300 Subject: [PATCH 2/9] fix: move test workflow under workflows --- .github/{ => workflows}/pull_request.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{ => workflows}/pull_request.yml (100%) diff --git a/.github/pull_request.yml b/.github/workflows/pull_request.yml similarity index 100% rename from .github/pull_request.yml rename to .github/workflows/pull_request.yml From 645241d5c093679a5cf186e8838af225d26e478b Mon Sep 17 00:00:00 2001 From: pheetah Date: Sun, 24 Dec 2023 16:47:34 +0300 Subject: [PATCH 3/9] fix: set up reaction on PR --- .github/workflows/pull_request.yml | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index bb24d70..9bde64e 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -1,10 +1,20 @@ name: Pull Request Testing -steps: -- uses: actions/checkout@v4 -- uses: actions/setup-python@v4 - with: - python-version: '3.11' - cache: 'pip' -- run: pip install -r requirements.txt -- run: pip test +on: + pull_request: + branches: [main] + +jobs: + setup: + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: '3.11' + cache: 'pip' + - run: pip install -r requirements.txt + + test: + steps: + - uses: actions/checkout@v4 + - run: pytest -o log_cli=true -o -vv \ No newline at end of file From 4862d30cbbc476598a91fbe027ed2b812363435d Mon Sep 17 00:00:00 2001 From: pheetah Date: Sun, 24 Dec 2023 16:49:44 +0300 Subject: [PATCH 4/9] fix: add python on testing step --- .github/workflows/pull_request.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 9bde64e..2d850e3 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -17,4 +17,7 @@ jobs: test: steps: - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: '3.11' - run: pytest -o log_cli=true -o -vv \ No newline at end of file From d399e53cb20c719e82374ba6a56437b2d593942d Mon Sep 17 00:00:00 2001 From: pheetah Date: Sun, 24 Dec 2023 16:52:19 +0300 Subject: [PATCH 5/9] fix: run on latest ubuntu --- .github/workflows/pull_request.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 2d850e3..d4fe224 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -5,7 +5,9 @@ on: branches: [main] jobs: + setup: + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 @@ -15,6 +17,7 @@ jobs: - run: pip install -r requirements.txt test: + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 From c2050e4e98d8e34b19d2ab4a483274fa260ec2ea Mon Sep 17 00:00:00 2001 From: pheetah Date: Sun, 24 Dec 2023 16:56:13 +0300 Subject: [PATCH 6/9] fix: merge CI steps --- .github/workflows/pull_request.yml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index d4fe224..3ae7ec4 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -6,7 +6,7 @@ on: jobs: - setup: + test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -14,13 +14,7 @@ jobs: with: python-version: '3.11' cache: 'pip' - - run: pip install -r requirements.txt - - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: '3.11' - - run: pytest -o log_cli=true -o -vv \ No newline at end of file + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + python -m pytest -o log_cli=true -s -vv --cov \ No newline at end of file From 42975a4b82596fa24c8103880ffb4bfd5206f3ec Mon Sep 17 00:00:00 2001 From: pheetah Date: Sun, 24 Dec 2023 16:58:32 +0300 Subject: [PATCH 7/9] fix: update CI steps --- .github/workflows/pull_request.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 3ae7ec4..450d876 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -10,11 +10,16 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - name: Set up Python + uses: actions/setup-python@v4 with: python-version: '3.11' cache: 'pip' - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - python -m pytest -o log_cli=true -s -vv --cov \ No newline at end of file + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Test with pytest + run: | + python -m pytest -o log_cli=true -s -vv --cov +s \ No newline at end of file From 845f3ba74e78f7bc0efc7add5133e006d2d4edb9 Mon Sep 17 00:00:00 2001 From: pheetah Date: Sun, 24 Dec 2023 16:58:45 +0300 Subject: [PATCH 8/9] fix: typo --- .github/workflows/pull_request.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 450d876..96e8944 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -21,5 +21,4 @@ jobs: pip install -r requirements.txt - name: Test with pytest run: | - python -m pytest -o log_cli=true -s -vv --cov -s \ No newline at end of file + python -m pytest -o log_cli=true -s -vv --cov \ No newline at end of file From 0726806c9ad0074febecd19c778af69b1db80f72 Mon Sep 17 00:00:00 2001 From: pheetah Date: Sun, 24 Dec 2023 17:04:25 +0300 Subject: [PATCH 9/9] fix: separate graphviz on CI bundle --- .github/workflows/pull_request.yml | 4 ++++ requirements.txt | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 96e8944..5b2d956 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -19,6 +19,10 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt + - name: Install Graphviz + run: | + sudo apt-get install graphviz graphviz-dev + pip install pygraphviz - name: Test with pytest run: | python -m pytest -o log_cli=true -s -vv --cov \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index c1209ab..be4e9a6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,5 @@ # main code-tokenize==0.2.0 -pygraphviz==1.11 # test pytest-cov==4.1.0 pytest==7.4.3 \ No newline at end of file