Skip to content

Commit

Permalink
add test env: docker
Browse files Browse the repository at this point in the history
  • Loading branch information
dothinking committed Jan 20, 2024
1 parent 4b36a49 commit a36f0bf
Showing 1 changed file with 27 additions and 73 deletions.
100 changes: 27 additions & 73 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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
path: ./test/outputs

0 comments on commit a36f0bf

Please sign in to comment.