From 771a7208021058cd85fecf40c07d408012ac964a Mon Sep 17 00:00:00 2001 From: jeffery Date: Fri, 3 Mar 2023 18:49:05 +0800 Subject: [PATCH 1/4] add github action --- .github/workflows/make_test_ebook.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/make_test_ebook.yaml diff --git a/.github/workflows/make_test_ebook.yaml b/.github/workflows/make_test_ebook.yaml new file mode 100644 index 0000000..55a40e9 --- /dev/null +++ b/.github/workflows/make_test_ebook.yaml @@ -0,0 +1,21 @@ +name: Pull Request +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + + testing: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.9' + cache: 'pip' # caching pip dependencies + - run: pip install -r requirements.txt + - run: python3 make.py --book_name test_books/animal_farm.epub --no_limit --test + \ No newline at end of file From 7426a60f0fbce0d1a49db1befa1906c0c365b55a Mon Sep 17 00:00:00 2001 From: jeffery Date: Fri, 3 Mar 2023 19:07:21 +0800 Subject: [PATCH 2/4] add name --- .github/workflows/make_test_ebook.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/make_test_ebook.yaml b/.github/workflows/make_test_ebook.yaml index 55a40e9..768f281 100644 --- a/.github/workflows/make_test_ebook.yaml +++ b/.github/workflows/make_test_ebook.yaml @@ -11,11 +11,15 @@ jobs: testing: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - name: install python 3.9 + uses: actions/setup-python@v4 with: python-version: '3.9' cache: 'pip' # caching pip dependencies - - run: pip install -r requirements.txt - - run: python3 make.py --book_name test_books/animal_farm.epub --no_limit --test + - name: checkout code + uses: actions/checkout@v3 + - name: install python requirements + run: pip install -r requirements.txt + - name: make test ebook + run: python3 make.py --book_name test_books/animal_farm.epub --no_limit --test \ No newline at end of file From e686f65db6400e00ef54e9f5b673ef08860f157c Mon Sep 17 00:00:00 2001 From: jeffery Date: Fri, 3 Mar 2023 19:11:29 +0800 Subject: [PATCH 3/4] add lint checks --- .github/workflows/make_test_ebook.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/make_test_ebook.yaml b/.github/workflows/make_test_ebook.yaml index 768f281..d90f89e 100644 --- a/.github/workflows/make_test_ebook.yaml +++ b/.github/workflows/make_test_ebook.yaml @@ -18,6 +18,8 @@ jobs: cache: 'pip' # caching pip dependencies - name: checkout code uses: actions/checkout@v3 + - name: Check formatting (black) + run: black . --check - name: install python requirements run: pip install -r requirements.txt - name: make test ebook From 489746c4becf087597b8a2ad4369b6898a796a36 Mon Sep 17 00:00:00 2001 From: jeffery Date: Fri, 3 Mar 2023 19:20:35 +0800 Subject: [PATCH 4/4] add OPENAI_KEY --- .github/workflows/make_test_ebook.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/make_test_ebook.yaml b/.github/workflows/make_test_ebook.yaml index d90f89e..153c0ae 100644 --- a/.github/workflows/make_test_ebook.yaml +++ b/.github/workflows/make_test_ebook.yaml @@ -23,5 +23,7 @@ jobs: - name: install python requirements run: pip install -r requirements.txt - name: make test ebook - run: python3 make.py --book_name test_books/animal_farm.epub --no_limit --test + env: + KEY: ${{ secrets.OPENAI_KEY }} + run: python3 make.py --book_name test_books/animal_farm.epub --openai_key $KEY --no_limit --test \ No newline at end of file