Skip to content

Attempt to parse predict input as JSON #3174

Attempt to parse predict input as JSON

Attempt to parse predict input as JSON #3174

Workflow file for this run

name: CI
on:
push:
branches:
- main
tags:
- "**"
pull_request:
branches:
- main
merge_group:
branches:
- main
types:
- checks_requested
jobs:
test-go:
name: "Test Go"
strategy:
fail-fast: false
matrix:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/specifications-for-github-hosted-runners#supported-runners-and-hardware-resources
platform: [ubuntu-latest-8-cores, macos-12]
runs-on: ${{ matrix.platform }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: go.mod
- uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install Python dependencies
run: |
python -m pip install '.[dev]'
yes | python -m mypy --install-types replicate || true
- name: Build
run: make cog
- name: Test
run: make test-go
test-python:
name: "Test Python ${{ matrix.python-version }}"
runs-on: ubuntu-latest-8-cores
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: |
python -m pip install '.[dev]'
yes | python -m mypy --install-types replicate || true
- name: Test
run: make test-python
env:
HYPOTHESIS_PROFILE: ci
# cannot run this on mac due to licensing issues: https://github.com/actions/virtual-environments/issues/2150
test-integration:
name: "Test integration"
runs-on: ubuntu-latest-16-cores
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: go.mod
- uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install Python dependencies
run: |
python -m pip install '.[dev]'
yes | python -m mypy --install-types replicate || true
- name: Test
run: make test-integration
release:
needs:
- test-go
- test-python
- test-integration
if: startsWith(github.ref, 'refs/tags/v')
outputs:
cog_version: ${{ steps.build-python-package.outputs.version }}
runs-on: ubuntu-latest-8-cores
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Build
run: make cog
- uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Python package
id: build-python-package
run: |
# clean package built for go client
rm -rf dist
# install build
pip install build
# build package
python -m build --wheel
# set output
echo "version=$(ls dist/ | cut -d- -f2)" >> $GITHUB_OUTPUT
- name: Push Python package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
packages-dir: dist