Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fast/slow CI core scaffold #2274

Merged
merged 16 commits into from
Jan 15, 2024
110 changes: 29 additions & 81 deletions .github/workflows/ci-fast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,72 +3,42 @@ name: Fast CI
on:
workflow_dispatch:
workflow_call:
# TODO: Reenable once stable
# push:
# branches: [main]
# paths-ignore: [docs/**, docker/**, '*', '!pyproject.toml', '**.md']
# pull_request:
# types: [opened, synchronize, ready_for_review]
# paths-ignore: [docs/**, docker/**, '*', '!pyproject.toml', '**.md']
push:
branches: [main]
paths-ignore: [docs/**, docker/**, '*', '!pyproject.toml', '**.md']
pull_request:
types: [opened, synchronize, ready_for_review]
paths-ignore: [docs/**, docker/**, '*', '!pyproject.toml', '**.md']
concurrency:
# New commit on branch cancels running workflows of the same branch
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
mlstacks-compatibility-check:
docstring-check:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
runs-on: ubuntu-dind-runners
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Set up Python
uses: actions/[email protected]
with:
python-version: '3.8'
python-version: '3.10'
avishniakov marked this conversation as resolved.
Show resolved Hide resolved
- name: Install current package as editable
run: |
pip install -U pip
pip install -e .
- name: Install mlstacks package
run: pip install mlstacks
- name: Check for broken dependencies
run: pip check
custom-ubuntu-runners-setup-and-test-python:
run: pip install -U darglint
- name: Check docstrings
run: bash scripts/docstring.sh
spellcheck:
if: github.event.pull_request.draft == false
strategy:
matrix:
os: [ubuntu-dind-runners]
python-version: ['3.8', '3.9', '3.10', '3.11']
fail-fast: false
uses: ./.github/workflows/setup-python-environment.yml
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
secrets: inherit
windows-setup-and-test-python:
if: github.event.pull_request.draft == false
strategy:
matrix:
os: [windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
fail-fast: false
uses: ./.github/workflows/setup-python-environment.yml
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
secrets: inherit
macos-setup-and-test-python:
if: github.event.pull_request.draft == false
strategy:
matrix:
os: [macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
fail-fast: false
uses: ./.github/workflows/setup-python-environment.yml
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
secrets: inherit
runs-on: ubuntu-dind-runners
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Spelling checker
uses: crate-ci/[email protected]
with:
files: .
config: ./.typos.toml
update-templates-to-examples:
# this doesn't work on forked repositories (i.e. outside contributors)
# so we disable template updates for those PRs / branches
Expand All @@ -78,46 +48,24 @@ jobs:
python-version: '3.8'
os: ubuntu-latest
secrets: inherit
windows-integration-test:
needs: [windows-setup-and-test-python]
custom-ubuntu-setup-and-unit-test:
if: github.event.pull_request.draft == false
strategy:
matrix:
os: [windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
test_environment: [default]
os: [ubuntu-dind-runners]
python-version: ['3.10']
fail-fast: false
uses: ./.github/workflows/integration-test.yml
uses: ./.github/workflows/unit-test.yml
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
test_environment: ${{ matrix.test_environment }}
secrets: inherit
macos-integration-test:
needs: [macos-setup-and-test-python]
strategy:
matrix:
os: [macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
test_environment: [default]
fail-fast: false
uses: ./.github/workflows/integration-test.yml
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
test_environment: ${{ matrix.test_environment }}
secrets: inherit
custom-ubuntu-runners-integration-test:
needs: [custom-ubuntu-runners-setup-and-test-python]
strategy:
matrix:
os: [ubuntu-dind-runners]
# Disabled temporarily while CI is overhauled
python-version: ['3.8', '3.9', '3.10']
# python-version: ["3.8", "3.9", "3.10", "3.11"]
test_environment:
- default
- docker-server-docker-orchestrator-mysql
- docker-server-docker-orchestrator-mariadb
python-version: ['3.10']
test_environment: [default, docker-server-docker-orchestrator-mysql]
exclude:
# docker is time-consuming to run, so we only run it on 3.8
- test_environment: docker-server-docker-orchestrator-mysql
Expand Down
163 changes: 129 additions & 34 deletions .github/workflows/ci-slow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,54 @@ name: Slow CI
on:
workflow_dispatch:
workflow_call:
# TODO: Reenable once stable
# push:
# branches: [main]
# paths-ignore: [docs/**, docker/**, '*', '!pyproject.toml', '**.md']
# pull_request:
# types: [opened, synchronize, ready_for_review]
# paths-ignore: [docs/**, docker/**, '*', '!pyproject.toml', '**.md']
issue_comment:
types: [created]
env:
TEAM_MEMBERS: '["@htahir1", "@hamza-zenml", "@bcdurak", "@baris-zenml", "@michael-zenml",
"@schustmi", "@strickvl", "@alex-zenml", "@alexej-zenml", "@AlexejPenner", "@stefannica",
"@wjayesh", "@safoinme", "@Cahllagerfeld", "@avishniakov", "@atzin-escandia"]'
concurrency:
# New commit on branch cancels running workflows of the same branch
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
mlstacks-compatibility-check:
if: github.event.pull_request.draft == false
check-membership:
runs-on: ubuntu-latest
outputs:
member_check: ${{ steps.is_member.outputs.member_check }}
steps:
- name: Check if commenter is a team member
id: is_member
run: |
if echo ${{ env.TEAM_MEMBERS }} | grep -q "${{ github.event.comment.user.login }}"; then
echo "::set-output name=member_check::true"
else
echo "::set-output name=member_check::false"
fi
docstring-check:
needs: check-membership
# if team member commented, not a draft, on a PR, using /fulltest
if: needs.check-membership.outputs.member_check == 'true' && github.event.pull_request.draft
== false && github.event.issue.pull_request && contains(github.event.comment.body,
'/fulltest')
runs-on: ubuntu-dind-runners
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Set up Python
uses: actions/[email protected]
with:
python-version: '3.10'
- name: Install current package as editable
run: pip install -U darglint
- name: Check docstrings
run: bash scripts/docstring.sh
small-checks:
needs: check-membership
# if team member commented, not a draft, on a PR, using /fulltest
if: needs.check-membership.outputs.member_check == 'true' && github.event.pull_request.draft
== false && github.event.issue.pull_request && contains(github.event.comment.body,
'/fulltest')
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -33,53 +67,108 @@ jobs:
run: pip install mlstacks
- name: Check for broken dependencies
run: pip check
custom-ubuntu-runners-setup-and-test-python:
if: github.event.pull_request.draft == false
- name: Markdown link check
uses: gaurav-nelson/[email protected]
with:
use-quiet-mode: 'yes'
use-verbose-mode: 'no'
folder-path: ./examples, ./docs/book, ./src
file-path: ./README.md, ./LICENSE, ./RELEASE_NOTES.md, CODE-OF-CONDUCT.md,
CONTRIBUTING.md, CLA.md, RELEASE_NOTES.md, ROADMAP.md
config-file: .github/workflows/markdown_check_config.json
continue-on-error: true
- name: Security check
run: |
pip install bandit
bash scripts/check-security.sh
- name: Check for alembic branch divergence
env:
ZENML_DEBUG: 0
run: |
pip install alembic
bash scripts/check-alembic-branches.sh
spellcheck:
needs: check-membership
# if team member commented, not a draft, on a PR, using /fulltest
if: needs.check-membership.outputs.member_check == 'true' && github.event.pull_request.draft
== false && github.event.issue.pull_request && contains(github.event.comment.body,
'/fulltest')
runs-on: ubuntu-dind-runners
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Spelling checker
uses: crate-ci/[email protected]
with:
files: .
config: ./.typos.toml
update-templates-to-examples:
needs: check-membership
# if team member commented, not a draft, on a PR, using /fulltest
if: needs.check-membership.outputs.member_check == 'true' && github.event.pull_request.draft
== false && github.event.issue.pull_request && contains(github.event.comment.body,
'/fulltest') && github.event.pull_request.head.repo.full_name == github.repository
# this doesn't work on forked repositories (i.e. outside contributors)
# so we disable template updates for those PRs / branches
uses: ./.github/workflows/update-templates-to-examples.yml
with:
python-version: '3.8'
os: ubuntu-latest
secrets: inherit
custom-ubuntu-unit-test:
needs: check-membership
# if team member commented, not a draft, on a PR, using /fulltest
if: needs.check-membership.outputs.member_check == 'true' && github.event.pull_request.draft
== false && github.event.issue.pull_request && contains(github.event.comment.body,
'/fulltest')
strategy:
matrix:
os: [ubuntu-dind-runners]
python-version: ['3.8', '3.9', '3.10', '3.11']
fail-fast: false
uses: ./.github/workflows/setup-python-environment.yml
uses: ./.github/workflows/unit-test.yml
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
secrets: inherit
windows-setup-and-test-python:
if: github.event.pull_request.draft == false
windows-unit-test:
needs: check-membership
# if team member commented, not a draft, on a PR, using /fulltest
if: needs.check-membership.outputs.member_check == 'true' && github.event.pull_request.draft
== false && github.event.issue.pull_request && contains(github.event.comment.body,
'/fulltest')
strategy:
matrix:
os: [windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
fail-fast: false
uses: ./.github/workflows/setup-python-environment.yml
uses: ./.github/workflows/unit-test.yml
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
secrets: inherit
macos-setup-and-test-python:
if: github.event.pull_request.draft == false
macos-unit-test:
needs: check-membership
# if team member commented, not a draft, on a PR, using /fulltest
if: needs.check-membership.outputs.member_check == 'true' && github.event.pull_request.draft
== false && github.event.issue.pull_request && contains(github.event.comment.body,
'/fulltest')
strategy:
matrix:
os: [macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
fail-fast: false
uses: ./.github/workflows/setup-python-environment.yml
uses: ./.github/workflows/unit-test.yml
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
secrets: inherit
update-templates-to-examples:
# this doesn't work on forked repositories (i.e. outside contributors)
# so we disable template updates for those PRs / branches
if: github.event.pull_request.head.repo.full_name == 'zenml-io/zenml'
uses: ./.github/workflows/update-templates-to-examples.yml
with:
python-version: '3.8'
os: ubuntu-latest
secrets: inherit
windows-integration-test:
needs: [windows-setup-and-test-python]
needs: check-membership
# if team member commented, not a draft, on a PR, using /fulltest
if: needs.check-membership.outputs.member_check == 'true' && github.event.pull_request.draft
== false && github.event.issue.pull_request && contains(github.event.comment.body,
'/fulltest')
strategy:
matrix:
os: [windows-latest]
Expand All @@ -93,7 +182,11 @@ jobs:
test_environment: ${{ matrix.test_environment }}
secrets: inherit
macos-integration-test:
needs: [macos-setup-and-test-python]
needs: check-membership
# if team member commented, not a draft, on a PR, using /fulltest
if: needs.check-membership.outputs.member_check == 'true' && github.event.pull_request.draft
== false && github.event.issue.pull_request && contains(github.event.comment.body,
'/fulltest')
strategy:
matrix:
os: [macos-latest]
Expand All @@ -106,14 +199,16 @@ jobs:
python-version: ${{ matrix.python-version }}
test_environment: ${{ matrix.test_environment }}
secrets: inherit
custom-ubuntu-runners-integration-test:
needs: [custom-ubuntu-runners-setup-and-test-python]
custom-ubuntu-integration-test:
needs: check-membership
# if team member commented, not a draft, on a PR, using /fulltest
if: needs.check-membership.outputs.member_check == 'true' && github.event.pull_request.draft
== false && github.event.issue.pull_request && contains(github.event.comment.body,
'/fulltest')
strategy:
matrix:
os: [ubuntu-dind-runners]
# Disabled temporarily while CI is overhauled
python-version: ['3.8', '3.9', '3.10']
# python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ['3.8', '3.9', '3.10', '3.11']
test_environment:
- default
- docker-server-docker-orchestrator-mysql
Expand Down
Loading
Loading