DraftKings Client #1290
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: DraftKings Client | |
on: | |
release: | |
types: [published] | |
push: | |
branches: | |
- v3 | |
pull_request: | |
schedule: | |
- cron: '0 22 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.7, 3.8, 3.9] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.ref }} | |
- name: Set Up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry | |
run: | | |
bash ./build.sh | |
- name: Install dependencies, run linting, run tests, and generate code coverage | |
run: | | |
poetry install | |
poetry run pylint -j 4 draft_kings tests | |
poetry run coverage run -m pytest | |
poetry run coverage xml | |
- name: Upload Coverage To Codecov | |
uses: codecov/codecov-action@v1 | |
with: | |
files: ./coverage.xml | |
fail_ci_if_error: true | |
verbose: true | |
docs: | |
name: Publish Documentation | |
runs-on: ubuntu-latest | |
needs: build | |
if: ${{ github.ref == 'refs/heads/v3' }} | |
strategy: | |
matrix: | |
python-version: [3.7] | |
poetry-version: [1.0.9] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.ref }} | |
- name: Set Up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up Poetry | |
uses: abatilo/[email protected] | |
with: | |
poetry-version: ${{ matrix.poetry-version }} | |
- name: Install dependencies | |
run: | | |
poetry install | |
- name: Set Git Configuration | |
run: | | |
REMOTE="https://${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}" | |
git config --global user.name "${GH_NAME}" | |
git config --global user.email "${GH_EMAIL}" | |
git remote set-url origin ${REMOTE} | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
GH_NAME: ${{ secrets.GH_NAME }} | |
GH_EMAIL: ${{ secrets.GH_EMAIL }} | |
- name: Deploy To GitHub Pages | |
run: | | |
poetry run mkdocs gh-deploy --clean --force |