feat: [TMX-1206] add function parameters for input examples and model signature #271
Workflow file for this run
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: Build & Deploy | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- master | |
types: [opened, synchronize] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checking out the repository | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
cache: pip | |
- name: Cache pip dependencies | |
uses: actions/cache@v2 | |
continue-on-error: true | |
id: pip-cache | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
- name: Install dependencies | |
run: poetry install | |
- name: Lint with flake8 | |
run: | | |
# exit-zero treats all errors as warnings. The GitHub editor is 88 chars wide | |
poetry run flake8 . --count --statistics | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checking out the repository | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
cache: pip | |
cache-dependency-path: '**/requirements*.txt' | |
- name: Cache pip dependencies | |
uses: actions/cache@v2 | |
continue-on-error: true | |
id: pip-cache | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
- name: Install dependencies | |
run: poetry install --no-dev | |
- name: Test with pytest | |
run: | | |
poetry run pytest tests --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html --cov-fail-under=80 --suppress-no-test-exit-code | |
poetry run coverage xml -i | |
cp -f coverage.xml coverage/ | |
- name: Upload test coverage files | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage | |
if-no-files-found: error | |
path: | | |
coverage/ | |
deploy: | |
if: github.ref_name == 'master' | |
needs: [lint, test] | |
name: Publish and build pypi package | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checking out the repository | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
cache: pip | |
cache-dependency-path: '**/requirements*.txt' | |
- name: Cache pip dependencies | |
uses: actions/cache@v2 | |
continue-on-error: true | |
id: pip-cache | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
- name: Install dependencies | |
run: poetry install --no-dev | |
- name: Build and publish to pypi | |
env: | |
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN_DATA_ML_UTILS }} | |
run: | | |
poetry config pypi-token.pypi $PYPI_TOKEN | |
poetry publish --build |