CI #415
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: CI | |
on: | |
push: | |
branches: | |
- development | |
- stable | |
pull_request: | |
schedule: | |
- cron: 0 0 * * 0 # weekly | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install build dependencies | |
uses: ./.github/actions/install-build-dependencies | |
- name: Build Python wheel | |
run: | | |
make bdist_wheel | |
if [ "$(uname)" != "Darwin" ]; then | |
make bdist_wheel-linux-rename | |
fi | |
env: | |
CC: clang | |
CXX: clang++ | |
BAZEL_OPTS: --batch | |
BAZEL_FETCH_OPTS: --config=ci | |
BAZEL_BUILD_OPTS: --config=ci | |
- name: Upload Python wheel | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ matrix.os }}-wheel | |
path: dist/*.whl | |
if-no-files-found: error | |
retention-days: 7 | |
test: | |
needs: build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
python: [3.6, 3.7, 3.8, 3.9] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Download Python wheel | |
uses: actions/download-artifact@v2 | |
with: | |
name: ${{ matrix.os }}-wheel | |
- name: Install wheel | |
run: python -m pip install *.whl | |
- name: Install test dependencies | |
run: python -m pip install -r tests/requirements.txt | |
# DGL creates ~/.dgl on first run and I have found that this will fail | |
# if run from pytest. | |
- name: Initialize DGL | |
run: | | |
python -c 'import dgl; print(dgl.__version__)' | |
shell: bash | |
- name: Test | |
run: make install-test |