Skip to content

Add predictions_to_bigquery to package #553

Add predictions_to_bigquery to package

Add predictions_to_bigquery to package #553

Workflow file for this run

name: CI
on:
push:
paths:
- 'tfx_addons/**'
- '.github/workflows/ci.yml'
- '.github/workflows/filter_projects.py'
- 'setup.py'
- 'pyproject.toml'
- '.github/ci/deps/**'
branches:
- main
- r*
pull_request:
paths:
- 'tfx_addons/**'
- '.github/workflows/ci.yml'
- '.github/workflows/filter_projects.py'
- 'setup.py'
- 'pyproject.toml'
- '.github/ci/deps/**'
branches:
- main
- r*
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
filter_projects:
# Dynamic matrix trick inspired by https://www.cynkra.com/blog/2020-12-23-dynamic-gha/
runs-on: ubuntu-latest
timeout-minutes: 60
outputs:
projects: ${{ steps.set-matrix.outputs.projects }}
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Get Changed Files
id: changed_files
uses: trilom/file-changes-action@v1.2.4
with:
output: json
- name: Filter projects
id: set-matrix
run: |
echo "projects=$(python ./.github/workflows/filter_projects.py $HOME/files.json)" >> $GITHUB_OUTPUT
ci:
runs-on: ubuntu-latest
needs: filter_projects
timeout-minutes: 60
if: needs.filter_examples.outputs.projects != '[]'
strategy:
# Test for each project in parallel using ci_max and ci_min to ensure
# tested in range of tfx/tensorflow supported versions
matrix:
project: ${{fromJson(needs.filter_projects.outputs.projects)}}
depconstraint:
- ci_max
- ci_min
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Cache python environment
uses: actions/cache@v2
with:
# Cache pip
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding setup.py + TFX version
key: ${{ runner.os }}-pip-${{ matrix.depconstraint }}-${{ hashFiles('tfx_addons/version.py') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.depconstraint }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install -e ".[${{ matrix.project }}, ${{ matrix.depconstraint }}, test]"
- name: Run tests
run: pytest tfx_addons/${{ matrix.project }}