-
Notifications
You must be signed in to change notification settings - Fork 22
61 lines (57 loc) · 1.67 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
name: ci
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
release:
types: [created]
jobs:
build-and-test:
name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}"
runs-on: "${{ matrix.os }}"
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8"]
os: [macos-latest, ubuntu-latest]
steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v1"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install dependencies"
run: |
set -xe
python -m pip install --upgrade pip setuptools wheel
python -m pip install pytest
shell: bash
- name: "Build"
run: |
if [[ `uname` == "Darwin" ]]
then
echo "build --macos_minimum_os=10.9" >> ${HOME}/.bazelrc
fi
set -xe
python -VV
bazel --version
python setup.py sdist
pip wheel --verbose --no-deps --no-clean dist/jaxline*.tar.gz
pip install jaxline*.whl
shell: bash
- name: "Run tests"
run: |
set -xe
# Change directory to avoid importing jaxline from repo root.
mkdir tests && pushd tests
python -m pytest -vv --pyargs jaxline
popd
shell: bash
- uses: actions/upload-artifact@v2
if: ${{ github.event_name == 'release' && github.event.action == 'created' }}
with:
path: jaxline*.whl
- uses: actions/upload-artifact@v2
if: ${{ github.event_name == 'release' && github.event.action == 'created' }}
with:
path: dist/jaxline*.tar.gz