diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e306c20..27eadcf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,11 +21,36 @@ on: # However, keep step 1 only, considering the difficulty to get a specific runner with MS Word installed. # ----------------------------------------------------------------------------------------------------- jobs: + + pdf2docx-docker: + + runs-on: ubuntu-latest + + container: + image: python:3.8 + + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install pytest + python setup.py develop + + - name: Run unit test + run: | + pytest -v ./test/test.py::TestConversion - pdf2docx: + + pdf2docx-ubuntu: runs-on: ubuntu-latest + needs: pdf2docx-docker + strategy: matrix: python-version: ["3.8", "3.9", "3.10"] @@ -60,75 +85,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: outputs - path: ./test/outputs - - - # docx2pdf: - # # a specific runner with MS Word installed - # runs-on: self-hosted - - # needs: pdf2docx - - # steps: - # - name: Checkout code - # uses: actions/checkout@v2 - - # # download artifacts from depending job - # - name: Download artifacts - # uses: actions/download-artifact@v2 - # with: - # name: outputs - # path: test\outputs - - # # convert docx to pdf with OfficeToPDF - # - name: Convert to PDF - # run: | - # cd test\outputs - # $files = Get-ChildItem "." - # for ($i=0; $i -lt $files.Count; $i++) { - # $name = $files[$i].name; - # echo "Converting $name to pdf..."; - # OfficeToPDF $files[$i] - # } - # del *.docx - - # # upload pdf for further job - # - name: Archive package - # uses: actions/upload-artifact@v2 - # with: - # name: outputs - # path: test\outputs - - - # check_quality: - - # runs-on: ubuntu-latest - - # needs: docx2pdf - - # steps: - # - name: Check out code - # uses: actions/checkout@v2 - - # # download artifacts from depending job - # - name: Download artifacts - # uses: actions/download-artifact@v2 - # with: - # name: outputs - # path: ./test/outputs - - # - name: Set up Python 3.x - # uses: actions/setup-python@v1 - # with: - # python-version: '3.x' - - # - name: Install dependencies - # run: | - # python -m pip install --upgrade pip - # pip install -r requirements.txt - # pip install pytest - # python setup.py develop - - # - name: Check converting quality - # run: | - # pytest -sv ./test/test.py::TestQuality \ No newline at end of file + path: ./test/outputs \ No newline at end of file