Prevent error from being raised when content type header is missing #97
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Build | |
on: [pull_request, workflow_dispatch] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
pip install pylint requests six python-dateutil | |
- name: Run Markdown Lint | |
uses: articulate/actions-markdownlint@v1 | |
with: | |
ignore: ./LICENSE.md | |
- name: Run Pylint | |
run: | | |
pylint smartsheet --rcfile pylintrc | |
mock-api-test: | |
needs: lint | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install certifi enum34 requests six python-dateutil coverage coveralls[yaml] pytest pytest-instafail requests-toolbelt | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Clone smartsheet/smartsheet-sdk-tests PUBLIC repository | |
uses: GuillaumeFalourd/clone-github-repo-action@v2 | |
with: | |
owner: 'smartsheet' | |
repository: 'smartsheet-sdk-tests' | |
- name: Setup Mock API | |
run: | | |
smartsheet-sdk-tests/ci_scripts/install_wiremock.sh | |
smartsheet-sdk-tests/ci_scripts/start_wiremock.sh | |
- name: Run mock API tests | |
run: | | |
coverage run --source=smartsheet setup.py test -a tests/mock_api/ | |
coverage lcov | |
- name: Coveralls Parallel | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
flag-name: run-${{ matrix.python-version }} | |
path-to-lcov: "coverage.lcov" | |
parallel: true | |
build-packages-test: | |
runs-on: ubuntu-latest | |
needs: [mock-api-test] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install build packages | |
run: | | |
pip install enum34 requests six python-dateutil setuptools-scm gitchangelog mako wheel twine | |
- name: Build distribution | |
run: | | |
python setup.py sdist bdist_wheel | |
- name: Archive distribution artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: distribution | |
path: dist | |
retention-days: 5 | |
build-documentation-test: | |
runs-on: ubuntu-latest | |
needs: [build-packages-test] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install documentation tools | |
run: | | |
pip install sphinx sphinx_rtd_theme setuptools-scm | |
- name: Generate API documentation | |
run: sphinx-apidoc -o docs-source smartsheet | |
- name: Generate HTML | |
run: sphinx-build -b html -d docs-source/_build/doctrees docs-source/. docs-source/_build/html | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: html-docs | |
path: docs/build/html/ | |
retention-days: 5 | |
finish: | |
needs: [build-documentation-test] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Coveralls Finished | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
parallel-finished: true | |
path-to-lcov: "coverage.lcov" |