mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-07 15:28:28 +01:00
* Set timeout for jobs in Github Actions Sometimes tests are getting frozen(most likely an issue with `pytest-xdist`), and sometimes the pip resolver is slow due to some weird constraints set by us or one of our dependencies. The default timeout is 360 minutes (6hrs), but our test completes on ~18 minutes at maximum, so I think 30mins should be enough to account for occasional CI slowdown. Also keeping the total job timeout at 45 mins, we usually require just 4 mins of extra time to do installation and setup but giving it 11 more minutes just in case. Similarly, `lint` completes in <5 mins usually, but giving it a 10 mins timeout. This should give us early feedback on the issue. * Update setup.cfg * Update setup.cfg
134 lines
4.1 KiB
YAML
134 lines
4.1 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
pull_request: {}
|
|
push: {}
|
|
schedule:
|
|
- cron: '5 1 * * *' # every day at 01:05
|
|
|
|
env:
|
|
DVC_TEST: "true"
|
|
HOMEBREW_NO_AUTO_UPDATE: 1
|
|
SHELL: /bin/bash
|
|
|
|
jobs:
|
|
lint:
|
|
timeout-minutes: 10
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/[email protected]
|
|
- name: Set up Python 3.8
|
|
uses: actions/[email protected]
|
|
with:
|
|
python-version: 3.8
|
|
- name: Install requirements
|
|
run: |
|
|
pip install wheel
|
|
pip install ".[all,tests,terraform]" Pygments collective.checkdocs pre-commit
|
|
- name: install temporary dependencies
|
|
run: |
|
|
pip install git+https://github.com/isidentical/gdrivefs@service-account
|
|
pip install git+https://github.com/isidentical/pydata-google-auth@service-account
|
|
- name: Check README
|
|
run: python setup.py checkdocs
|
|
- uses: pre-commit/[email protected]
|
|
tests:
|
|
timeout-minutes: 45
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-18.04, windows-2019, macos-10.15]
|
|
pyv: ["3.6", "3.7", "3.8", "3.9"]
|
|
include:
|
|
- os: "macos-10.15"
|
|
pyv: "3.10.0-rc.1"
|
|
exclude:
|
|
- os: macos-10.15
|
|
pyv: "3.9"
|
|
- os: macos-10.15
|
|
pyv: "3.7"
|
|
|
|
steps:
|
|
- uses: actions/[email protected]
|
|
- name: Set up Python
|
|
uses: actions/[email protected]
|
|
with:
|
|
python-version: ${{ matrix.pyv }}
|
|
- name: get pip cache dir
|
|
id: pip-cache-dir
|
|
run: |
|
|
echo "::set-output name=dir::$(pip cache dir)"
|
|
- name: set pip cache
|
|
id: pip-cache
|
|
uses: actions/[email protected]
|
|
with:
|
|
path: ${{ steps.pip-cache-dir.outputs.dir }}
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pip-
|
|
- name: install libgit2 on Python3.10 in macOS
|
|
if: matrix.pyv == '3.10.0-rc.1' && matrix.os == 'macos-10.15'
|
|
run: |
|
|
brew install libgit2
|
|
- name: install
|
|
if: steps.cache.pip-cache-dir.cache-hit != 'true'
|
|
run: |
|
|
pip install --upgrade pip setuptools wheel
|
|
pip install -e ".[all,tests,terraform]"
|
|
- name: install temporary dependencies
|
|
run: |
|
|
pip install git+https://github.com/isidentical/gdrivefs@service-account
|
|
pip install git+https://github.com/isidentical/pydata-google-auth@service-account
|
|
- name: setup git
|
|
run: |
|
|
git config --global user.email "[email protected]"
|
|
git config --global user.name "DVC Tester"
|
|
- name: setup gs creds
|
|
shell: bash
|
|
env:
|
|
GS_CREDS_JSON: ${{ secrets.GS_CREDS_JSON }}
|
|
if: env.GS_CREDS_JSON != ''
|
|
run: |
|
|
mkdir -p scripts/ci
|
|
echo "$GS_CREDS_JSON" > scripts/ci/gcp-creds.json
|
|
- name: disable gdrive tests
|
|
if: >-
|
|
github.event_name != 'schedule' &&
|
|
(matrix.pyv != '3.8' || matrix.os != 'ubuntu-18.04')
|
|
run: |
|
|
echo "extra_test_args=--disable-gdrive" >> $GITHUB_ENV
|
|
- name: run tests
|
|
timeout-minutes: 30
|
|
env:
|
|
GDRIVE_CREDENTIALS_DATA: ${{ secrets.GDRIVE_CREDENTIALS_DATA }}
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
OSS_ACCESS_KEY_ID: ${{ secrets.OSS_ACCESS_KEY_ID}}
|
|
OSS_ACCESS_KEY_SECRET: ${{ secrets.OSS_ACCESS_KEY_SECRET}}
|
|
OSS_ENDPOINT: ${{ secrets.OSS_ENDPOINT}}
|
|
run: >-
|
|
python -m tests -n=4
|
|
--cov-report=xml --cov-report=term
|
|
--all ${{ env.extra_test_args }}
|
|
- name: upload coverage report
|
|
uses: codecov/[email protected]
|
|
with:
|
|
file: ./coverage.xml
|
|
fail_ci_if_error: false
|
|
notify:
|
|
if: github.ref == 'refs/heads/master' && 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 master :boom:'
|
|
SLACK_TITLE: CI Status
|
|
SLACK_USERNAME: DVC-CI
|