[WIP] Build against TF2.16 #5133
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: addons-release | |
on: | |
release: | |
types: [published] | |
tags: | |
- v* | |
push: | |
branches: | |
- master | |
- r* | |
pull_request: | |
branches: | |
- master | |
- r* | |
permissions: | |
contents: read | |
env: | |
MIN_PY_VERSION: '3.9' | |
MAX_PY_VERSION: '3.12' | |
jobs: | |
test-with-bazel: | |
name: Test with bazel | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ env.MIN_PY_VERSION }} | |
- name: Build wheels | |
run: | | |
pip install --default-timeout=1000 -r tools/install_deps/pytest.txt -r tools/install_deps/tensorflow-cpu.txt -r requirements.txt | |
bash tools/install_deps/install_bazelisk.sh ./ | |
python configure.py | |
bazel test -k --test_timeout 300,450,1200,3600 --test_output=errors //tensorflow_addons/... | |
release-wheel: | |
name: Test and build release wheels | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# To switch on windows-2022/latest, please verify the bazel version: | |
# https://github.com/bazelbuild/bazel/issues/14232#issuecomment-1011247429 | |
os: ['macos-12', 'ubuntu-20.04'] | |
# Removing windows builds due to broken upstream package https://github.com/tensorflow/tensorflow/issues/61830 | |
# os: ['macos-12', 'windows-2019', 'ubuntu-20.04'] | |
py-version: ['3.9', '3.10', '3.11', '3.12'] | |
tf-version: ['2.14.1', '2.15.1', '2.16.1'] | |
cpu: ['x86'] | |
include: | |
- py-version: '3.12' | |
tf-version: '2.16.1' | |
fail-fast: false | |
steps: | |
- uses: actions/[email protected] | |
id: author-date | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
const commit_details = await github.git.getCommit({owner: context.repo.owner, repo: context.repo.repo, commit_sha: context.sha}); | |
return commit_details.data.author.date | |
- if: matrix.tf-version != '2.16.1' | |
shell: bash | |
run: echo "SKIP_CUSTOM_OP_TESTS=--skip-custom-ops" >> $GITHUB_ENV | |
- if: github.event_name == 'push' | |
shell: bash | |
run: echo "NIGHTLY_FLAG=--nightly" >> $GITHUB_ENV | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.py-version }} | |
- if: matrix.os != 'ubuntu-20.04' | |
name: Setup Bazel | |
# Ubuntu bazel is run inside of the docker image | |
run: bash tools/install_deps/install_bazelisk.sh ./ | |
- name: Build wheels | |
env: | |
OS: ${{ runner.os }} | |
PY_VERSION: ${{ matrix.py-version }} | |
TF_VERSION: ${{ matrix.tf-version }} | |
NIGHTLY_TIME: ${{ steps.author-date.outputs.result }} | |
CPU: ${{ matrix.cpu }} | |
shell: bash | |
run: bash .github/workflows/make_wheel_${OS}_${CPU}.sh | |
- uses: actions/upload-artifact@v1 | |
with: | |
name: ${{ runner.os }}-${{ matrix.py-version }}-tf${{ matrix.tf-version }}-${{ matrix.cpu }}-wheel | |
path: wheelhouse | |
upload-wheels: | |
name: Publish wheels to PyPi | |
needs: [release-wheel, test-with-bazel] | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
os: ['macOS', 'Linux'] | |
# Removing windows builds due to broken upstream package https://github.com/tensorflow/tensorflow/issues/61830 | |
# os: ['macOS', 'Windows', 'Linux'] | |
py-version: ['3.9', '3.10', '3.11', '3.12'] | |
tf-version: ['2.16.1'] | |
cpu: ['x86'] | |
include: | |
- py-version: '3.12' | |
tf-version: '2.16.1' | |
fail-fast: false | |
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'release' | |
steps: | |
- uses: actions/download-artifact@v1 | |
with: | |
name: ${{ matrix.os }}-${{ matrix.py-version }}-tf${{ matrix.tf-version }}-${{ matrix.cpu }}-wheel | |
path: ./dist | |
- run: | | |
set -e -x | |
ls -la dist/ | |
sha256sum dist/*.whl | |
- uses: pypa/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_token }} | |
upload-dev-container: | |
name: Upload dev container to DockerHub | |
needs: [release-wheel, test-with-bazel] | |
runs-on: ubuntu-20.04 | |
env: | |
PY_VERSION: '3.9' | |
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') | |
steps: | |
- uses: actions/checkout@v2 | |
- run: | | |
set -e -x | |
echo ${{ secrets.DOCKER_PW }} | docker login --username ${{ secrets.DOCKER_USER }} --password-stdin | |
bash .github/workflows/github_build_dev_container.sh | |
docker push tfaddons/dev_container:latest-gpu |