diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..7414097b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,37 @@ +name: build + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + run: | + pip install tf-nightly mock pytest + pip install -e .[auto_mtf,transformer] + - name: Test with pytest + run: pytest + # The below step just reports the success or failure of tests as a "commit status". + # This is needed for copybara integration. + - name: Report success or failure as github status + if: always() + shell: bash + run: | + status="${{ job.status }}" + lowercase_status=$(echo $status | tr '[:upper:]' '[:lower:]') + curl -sS --request POST \ + --url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }} \ + --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ + --header 'content-type: application/json' \ + --data '{ + "state": "'$lowercase_status'", + "target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", + "description": "'$status'", + "context": "github-actions/build" + }' diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3f1fce44..00000000 --- a/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -sudo: required -language: python -git: - depth: 10 - quiet: true -python: - - "3.7" -install: - - ./oss_scripts/oss_pip_install.sh -script: - - ./oss_scripts/oss_tests.sh diff --git a/README.md b/README.md index 9d5edf1c..88dabba7 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Issues](https://img.shields.io/github/issues/tensorflow/mesh.svg)](https://githu [![Contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](CONTRIBUTING.md) [![License](https://img.shields.io/badge/License-Apache%202.0-brightgreen.svg)](https://opensource.org/licenses/Apache-2.0) -[![Travis](https://img.shields.io/travis/tensorflow/mesh.svg)](https://travis-ci.org/tensorflow/mesh) +[![Build Status](https://github.com/tensorflow/mesh/workflows/build/badge.svg)](https://github.com/tensorflow/mesh/actions?query=workflow%3Abuild) # Introduction