|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - develop |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - develop |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + name: ubuntu-latest x ${{ matrix.python }} |
| 14 | + runs-on: ubuntu-latest |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + python: ["3.7"] |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v2 |
| 21 | + |
| 22 | + - uses: actions/setup-python@v1 |
| 23 | + with: |
| 24 | + python-version: ${{ matrix.python }} |
| 25 | + |
| 26 | + - name: Cache venv |
| 27 | + uses: actions/cache@v2 |
| 28 | + with: |
| 29 | + path: ~/.local/share/virtualenvs |
| 30 | + key: ${{ runner.os }}-build-${{ matrix.python }}-${{ hashFiles('poetry.lock') }} |
| 31 | + |
| 32 | + - name: Install dependencies |
| 33 | + run: | |
| 34 | + pip install poetry |
| 35 | + poetry install |
| 36 | +
|
| 37 | + - name: Print tool versions |
| 38 | + run: | |
| 39 | + poetry run mypy --version |
| 40 | + poetry run pylint --version |
| 41 | + poetry run pytest --version |
| 42 | + poetry run black --version |
| 43 | +
|
| 44 | + - name: Check if the code is formatted |
| 45 | + run: poetry run black --check --quiet dataprep |
| 46 | + |
| 47 | + - name: Type check the project |
| 48 | + run: poetry run mypy dataprep |
| 49 | + |
| 50 | + - name: Test the project |
| 51 | + run: poetry run pytest --cov=dataprep dataprep/tests |
| 52 | + env: |
| 53 | + DATAPREP_BROWSER_TESTS: 0 |
| 54 | + DATAPREP_CREDENTIAL_TESTS: 0 |
| 55 | + DATAPREP_DATA_CONNECTOR_YELP_TOKEN: "" |
| 56 | + DATAPREP_DATA_CONNECTOR_YOUTUBE_TOKEN: "" |
| 57 | + |
| 58 | + - name: Style check the project |
| 59 | + run: poetry run pylint dataprep |
| 60 | + |
| 61 | + - uses: codecov/codecov-action@v2 |
| 62 | + with: |
| 63 | + verbose: true |
| 64 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 65 | + # path_to_write_report: ./coverage.xml |
| 66 | + |
| 67 | + - uses: codacy/codacy-coverage-reporter-action@v1 |
| 68 | + with: |
| 69 | + project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} |
| 70 | + coverage-reports: coverage.xml |
| 71 | + |
| 72 | + docs-build: |
| 73 | + runs-on: ubuntu-latest |
| 74 | + needs: build |
| 75 | + steps: |
| 76 | + - uses: actions/checkout@v2 |
| 77 | + |
| 78 | + - name: Install dependencies |
| 79 | + run: | |
| 80 | + pip install poetry |
| 81 | + poetry config virtualenvs.in-project true |
| 82 | +
|
| 83 | + - name: Cache venv |
| 84 | + uses: actions/cache@v2 |
| 85 | + with: |
| 86 | + path: ~/.local/share/virtualenvs |
| 87 | + key: ${{ runner.os }}-build-${{ matrix.python }}-${{ hashFiles('poetry.lock') }} |
| 88 | + |
| 89 | + - name: Install dependencies |
| 90 | + run: | |
| 91 | + pip install poetry |
| 92 | + poetry install |
| 93 | +
|
| 94 | + - name: Build docs |
| 95 | + run: poetry run sphinx-build -M html docs/source docs/build |
| 96 | + |
| 97 | + - name: Archive docs |
| 98 | + uses: actions/upload-artifact@v2 |
| 99 | + with: |
| 100 | + name: docs |
| 101 | + path: docs/build/html |
| 102 | + |
| 103 | + docs-deploy: |
| 104 | + runs-on: ubuntu-latest |
| 105 | + needs: docs-build |
| 106 | + if: ${{ github.ref == 'ref/heads/master' && github.event == 'push' }} |
| 107 | + steps: |
| 108 | + - name: Download docs |
| 109 | + uses: actions/download-artifact@v2 |
| 110 | + with: |
| 111 | + name: docs |
| 112 | + |
| 113 | + - run: echo 'docs.dataprep.ai' > docs/build/html/CNAME |
| 114 | + |
| 115 | + - name: Deploy 🚀 |
| 116 | + |
| 117 | + with: |
| 118 | + branch: gh-pages # The branch the action should deploy to. |
| 119 | + folder: docs/build/html # The folder the action should deploy. |
| 120 | + clean-exclude: dev |
0 commit comments