mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
* remove .codecov.yml and MANIFEST.in, move .coveragerc to pyproject.toml * remove scripts/pypi_upload.sh
91 lines
2.3 KiB
YAML
91 lines
2.3 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
schedule:
|
|
- cron: '5 1 * * *' # every day at 01:05
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
DVC_TEST: "true"
|
|
HOMEBREW_NO_AUTO_UPDATE: 1
|
|
SHELL: /bin/bash
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
permissions: # added using https://github.com/step-security/secure-workflows
|
|
contents: read
|
|
|
|
jobs:
|
|
lint:
|
|
timeout-minutes: 10
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Set up Python 3.8
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 3.8
|
|
cache: pip
|
|
cache-dependency-path: pyproject.toml
|
|
- name: Install requirements
|
|
run: |
|
|
pip install --upgrade pip wheel
|
|
pip install ".[dev]"
|
|
- uses: pre-commit/[email protected]
|
|
tests:
|
|
timeout-minutes: 45
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-20.04, windows-latest, macos-latest]
|
|
pyv: ["3.8", "3.9", "3.10"]
|
|
pytest-filter:
|
|
- "import or plot or live or experiment"
|
|
- "not (import or plot or live or experiment)"
|
|
include:
|
|
- {os: ubuntu-latest, pyv: "3.11-dev"}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.pyv }}
|
|
cache: pip
|
|
cache-dependency-path: pyproject.toml
|
|
- name: install
|
|
run: |
|
|
pip install --upgrade pip wheel
|
|
pip install -e ".[dev]"
|
|
- name: run tests
|
|
timeout-minutes: 20
|
|
run: pytest -nauto --durations 100 --cov --cov-report=xml --cov-report=term -k "${{ matrix.pytest-filter }}"
|
|
- name: upload coverage report
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage.xml
|
|
fail_ci_if_error: false
|
|
notify:
|
|
if: github.ref == 'refs/heads/main' && failure()
|
|
needs: [lint, tests]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Slack Notification
|
|
uses: rtCamp/[email protected]
|
|
env:
|
|
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
|
SLACK_COLOR: ${{ job.status }}
|
|
SLACK_MESSAGE: 'CI Failed on main :boom:'
|
|
SLACK_TITLE: CI Status
|
|
SLACK_USERNAME: DVC-CI
|