|
| 1 | +name: beta-cicd-setup-and-test |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - 'v*.0.0-beta.*' |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - 'v*.0.0-beta.*' |
| 10 | + |
| 11 | +jobs: |
| 12 | + lint: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - name: Check out repo |
| 16 | + uses: actions/checkout@v4 |
| 17 | + - name: Set up Python |
| 18 | + uses: actions/setup-python@v4 |
| 19 | + with: |
| 20 | + python-version: "3.10" |
| 21 | + - name: Install pre-commit |
| 22 | + run: pip install pre-commit |
| 23 | + - name: Run pre-commit |
| 24 | + run: pre-commit run --all-files |
| 25 | + |
| 26 | + build: |
| 27 | + runs-on: ubuntu-latest |
| 28 | + strategy: |
| 29 | + matrix: |
| 30 | + python-version: ["3.10"] |
| 31 | + steps: |
| 32 | + - name: Check out repo |
| 33 | + uses: actions/checkout@v4 |
| 34 | + - name: Free Disk Space (Ubuntu) |
| 35 | + uses: jlumbroso/free-disk-space@main |
| 36 | + with: |
| 37 | + # this might remove tools that are actually needed, |
| 38 | + # if set to "true" but frees about 6 GB |
| 39 | + tool-cache: false |
| 40 | + # all of these default to true, but feel free to set to |
| 41 | + # "false" if necessary for your workflow |
| 42 | + android: true |
| 43 | + dotnet: true |
| 44 | + haskell: true |
| 45 | + large-packages: true |
| 46 | + docker-images: true |
| 47 | + swap-storage: true |
| 48 | + - name: Set up Python |
| 49 | + uses: actions/setup-python@v4 |
| 50 | + with: |
| 51 | + python-version: ${{ matrix.python-version }} |
| 52 | + - name: Install Tesseract OCR |
| 53 | + run: | |
| 54 | + sudo apt-get update |
| 55 | + sudo apt-get install -y software-properties-common |
| 56 | + sudo add-apt-repository -y ppa:alex-p/tesseract-ocr-devel |
| 57 | + sudo apt-get update |
| 58 | + sudo apt-get install -y tesseract-ocr libtesseract-dev |
| 59 | + tesseract --version |
| 60 | + dpkg -l | grep tesseract |
| 61 | + - name: Verify Tesseract Installation |
| 62 | + run: | |
| 63 | + which tesseract |
| 64 | + tesseract --list-langs |
| 65 | + - name: Install Dependencies |
| 66 | + run: | |
| 67 | + pip install -U pip |
| 68 | + pip install --no-cache-dir -e . |
| 69 | + pip install --no-cache-dir tox just pre-commit |
| 70 | + - name: Free up disk space |
| 71 | + run: | |
| 72 | + sudo apt-get clean |
| 73 | + - name: Run Tests with tox |
| 74 | + run: tox -- --cov datafog --cov-report xml --cov-report term -v -s --cov-report=term-missing |
| 75 | + - name: Submit to Codecov |
| 76 | + uses: codecov/codecov-action@v3 |
| 77 | + with: |
| 78 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 79 | + files: ./coverage.xml |
| 80 | + flags: unittests |
| 81 | + name: codecov-umbrella |
0 commit comments