-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1525 from microsoft/staging
Merge from staging to main for release 0.7.0
- Loading branch information
Showing
22 changed files
with
1,043 additions
and
254 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,240 @@ | ||
# --------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
# --------------------------------------------------------- | ||
|
||
# NOTE: | ||
# This file defines following CI workflow: | ||
# ┌──────────┐ ┌─────────┐ ┌────────┐ | ||
# │ static ├─┬─► build* ├─┬─► test │ | ||
# │ analysis │ │ │ (cpu) │ │ │ report │ | ||
# └──────────┘ │ └─────────┘ │ └────────┘ | ||
# │ ┌─────────┐ │ | ||
# ├─► build* ├─┤ | ||
# │ │ (spark) │ │ | ||
# │ └─────────┘ │ | ||
# │ ┌─────────┐ │ | ||
# └─► build* ├─┘ | ||
# │ (gpu) │ | ||
# └─────────┘ | ||
# .... | ||
# *each runs in PARALLEL the different combinations | ||
# of python version, OS, test subsets, etc | ||
# | ||
# There are 3 compute environments our library is supporting: CPU, GPU and Spark | ||
# This pipeline's goal is to ensure we run and pass our tests in these supported compute | ||
# For all of the jobs in GPU build, we are using self-host VMs to run them. | ||
# For the rest of the jobs, with the exception of integration tests (#1507), we will use default agents provided by GitHub | ||
# | ||
# ASCII chart created via https://asciiflow.com/ | ||
name: nightly | ||
|
||
on: | ||
# ┌───────────── minute (0 - 59) | ||
# │ ┌───────────── hour (0 - 23) | ||
# │ │ ┌───────────── day of the month (1 - 31) | ||
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) | ||
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) | ||
# │ │ │ │ │ | ||
# │ │ │ │ │ | ||
schedule: | ||
- cron: '0 0 * * *' # basically running everyday at 12AM | ||
# cron works with default branch (main) only: # https://github.community/t/on-schedule-per-branch/17525/2 | ||
|
||
push: | ||
# because we can't schedule runs for non-main branches, | ||
# to ensure we are running the build on the staging branch, we can add push policy for it | ||
branches: [staging] | ||
|
||
# enable manual trigger | ||
workflow_dispatch: | ||
input: | ||
tags: | ||
description: 'Test scenario tags' | ||
default: 'Anything to describe this manual run (optional)' | ||
|
||
|
||
jobs: | ||
############################################### | ||
############### STATIC-ANALYSIS ############### | ||
############################################### | ||
static-analysis: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Python 3.6 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.6 | ||
|
||
- name: Install dependencies (tox) | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel | ||
pip install tox | ||
- name: Run flake8 | ||
# TODO: re-enable this flake8 block (turned off to get a draft of the pipeline infrastructure) | ||
continue-on-error: true | ||
run: | | ||
tox -e flake8 | ||
############################################### | ||
################## CPU-BUILD ################## | ||
############################################### | ||
build-cpu: | ||
runs-on: ${{ matrix.os }} | ||
needs: static-analysis | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
python: [3.6] | ||
# different kinds of tests are located in tests/<unit|integration|smoke> folders | ||
test-kind: ['unit', 'smoke'] | ||
# pytest markers configured in tox.ini. See https://docs.pytest.org/en/6.2.x/example/markers.html | ||
test-marker: ['not spark and not gpu'] | ||
include: | ||
# Integration tests need a powerful machine with more memory. GitHub-hosted agents only have 7GB memory. | ||
# TODO: Optimization/refactoring should be done to ensure that these test can run in the default CI agent (#1507) | ||
- os: self-hosted | ||
python: 3.6 | ||
test-kind: 'integration' | ||
test-marker: 'not spark and not gpu' | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
################# Run Python tests ################# | ||
- name: Use Python ${{ matrix.python }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
# There are little documentation on how to call **local** actions | ||
# https://docs.github.com/en/actions/creating-actions/about-actions#choosing-a-location-for-your-action | ||
# but there is some working insights from this discussion: | ||
# https://github.community/t/path-to-action-in-the-same-repository-as-workflow/16952/2 | ||
- name: Run ${{ matrix.test-kind }} tests ('${{ matrix.test-marker }}') | ||
uses: ./.github/workflows/actions/run-tests | ||
with: | ||
test-kind: ${{ matrix.test-kind }} | ||
test-marker: ${{ matrix.test-marker }} | ||
# Currently GitHub workflow cannot call an action from another action | ||
# https://github.community/t/call-an-action-from-another-action/17524 | ||
# Else this shared step can also be move to the local action: .github/workflows/actions/run-tests | ||
- name: Upload Code Coverage | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: code-cov | ||
path: .coverage* | ||
|
||
############################################### | ||
################# SPARK-BUILD ################# | ||
############################################### | ||
build-spark: | ||
runs-on: ${{ matrix.os }} | ||
needs: static-analysis | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
java: [8] | ||
python: [3.6] | ||
# different kinds of tests are located in tests/<unit|integration|smoke> folders | ||
test-kind: ['unit', 'smoke'] | ||
# pytest markers configured in tox.ini. See https://docs.pytest.org/en/6.2.x/example/markers.html | ||
test-marker: ['spark and not gpu'] | ||
include: | ||
# Integration tests need a powerful machine with more memory. GitHub-hosted agents only have 7GB memory. | ||
# TODO: Optimization/refactoring should be done to ensure that these test can run in the default CI agent (#1507) | ||
- os: self-hosted | ||
java: 8 | ||
python: 3.6 | ||
test-kind: 'integration' | ||
test-marker: 'spark and not gpu' | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
################# Install spark dependencies (java) ################# | ||
- name: Setup Java JDK | ||
uses: actions/[email protected] | ||
with: | ||
java-version: ${{ matrix.java }} | ||
distribution: 'adopt' | ||
|
||
################# Run Python tests ################# | ||
- name: Use Python ${{ matrix.python }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Run ${{ matrix.test-kind }} tests ('${{ matrix.test-marker }}') | ||
uses: ./.github/workflows/actions/run-tests | ||
with: | ||
test-kind: ${{ matrix.test-kind }} | ||
test-marker: ${{ matrix.test-marker }} | ||
|
||
- name: Upload Code Coverage | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: code-cov | ||
path: .coverage* | ||
|
||
############################################### | ||
################# GPU-BUILD ################# | ||
############################################### | ||
build-gpu: | ||
runs-on: [self-hosted, Linux, gpu] # this is a union of labels to select specific self-hosted machine | ||
needs: static-analysis | ||
strategy: | ||
matrix: | ||
python: [3.6] | ||
# different kinds of tests are located in tests/<unit|integration|smoke> folders | ||
test-kind: ['unit', 'smoke', 'integration'] | ||
# pytest markers configured in tox.ini. See https://docs.pytest.org/en/6.2.x/example/markers.html | ||
test-marker: ['gpu and not spark'] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
################# Run Python tests ################# | ||
- name: Use Python ${{ matrix.python }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Run ${{ matrix.test-kind }} tests ('${{ matrix.test-marker }}') | ||
uses: ./.github/workflows/actions/run-tests | ||
with: | ||
test-kind: ${{ matrix.test-kind }} | ||
test-marker: ${{ matrix.test-marker }} | ||
|
||
- name: Upload Code Coverage | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: code-cov | ||
path: .coverage* | ||
|
||
############################################### | ||
############ TEST COVERAGE SUMMARY ############ | ||
############################################### | ||
collect-code-cov: | ||
runs-on: ubuntu-latest | ||
needs: [build-cpu, build-spark, build-gpu] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: '3.6' | ||
|
||
- name: Download coverage reports from all previous jobs | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: code-cov | ||
|
||
- name: Merge coverage reports | ||
uses: ./.github/workflows/actions/merge-cov | ||
|
||
- name: Upload code coverage report to CodeCov | ||
uses: codecov/[email protected] | ||
with: | ||
fail_ci_if_error: true | ||
# comes from the last 'Merge coverage reports' step | ||
files: ./coverage.xml |
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
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
Oops, something went wrong.