-
Notifications
You must be signed in to change notification settings - Fork 53
46 lines (39 loc) · 1.37 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Continuous integration for AutoDP python using Bazel to build and test code.
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: CI
on: [push, pull_request]
jobs:
build-and-test:
name: "Python ${{ matrix.python-version }}"
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
steps:
# Checks-out the repository under $GITHUB_WORKSPACE, which is the CWD for
# the rest of the steps
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install pytype
# Caches and restores the bazel build directory.
- name: Cache bazel build results
uses: actions/[email protected]
env:
cache-name: bazel-cache
with:
path: ~/.cache/bazel
key: ${{ runner.os }}-${{ env.cache-name }}-${{ github.ref }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-master
- name: Build the code
run: bazel build ...
- name: Test the code
run: bazel test --test_output=errors ...
- name: Type-Check
run: pytype -j auto -d import-error