|
1 | 1 | name: Tests
|
2 | 2 |
|
3 | 3 | on:
|
4 |
| - pull_request: {} |
5 |
| - push: {} |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
6 | 7 | schedule:
|
7 | 8 | - cron: '5 1 * * *' # every day at 01:05
|
8 |
| - |
9 | 9 | workflow_dispatch:
|
10 | 10 |
|
11 |
| -env: |
12 |
| - DVC_TEST: "true" |
13 |
| - HOMEBREW_NO_AUTO_UPDATE: 1 |
14 |
| - SHELL: /bin/bash |
| 11 | +concurrency: |
| 12 | + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 13 | + cancel-in-progress: true |
| 14 | + |
| 15 | +permissions: |
| 16 | + contents: read |
15 | 17 |
|
16 | 18 | jobs:
|
17 |
| - lint: |
18 |
| - timeout-minutes: 10 |
19 |
| - runs-on: ubuntu-latest |
20 |
| - steps: |
21 |
| - - name: Cancel Previous Runs |
22 |
| - uses: styfle/cancel-workflow-action@0.9.1 |
23 |
| - with: |
24 |
| - access_token: ${{ github.token }} |
25 |
| - - uses: actions/checkout@v2.4.0 |
26 |
| - with: |
27 |
| - fetch-depth: 0 |
28 |
| - - name: Set up Python 3.8 |
29 |
| - uses: actions/setup-python@v2.2.2 |
30 |
| - with: |
31 |
| - python-version: 3.8 |
32 |
| - - name: Install requirements |
33 |
| - run: | |
34 |
| - pip install wheel |
35 |
| - pip install -e '.[tests]' |
36 |
| - pip install git+https://github.com/iterative/dvc pre-commit |
37 |
| - - name: Check README |
38 |
| - run: python setup.py checkdocs |
39 |
| - - uses: pre-commit/action@v2.0.3 |
40 | 19 | tests:
|
41 | 20 | timeout-minutes: 45
|
42 | 21 | runs-on: ${{ matrix.os }}
|
43 | 22 | strategy:
|
44 | 23 | fail-fast: false
|
45 | 24 | matrix:
|
46 | 25 | os: [ubuntu-20.04, windows-latest, macos-latest]
|
47 |
| - pyv: ["3.8", "3.9", "3.10"] |
48 |
| - exclude: |
49 |
| - # no wheels for pygit2 yet |
50 |
| - - os: windows-latest |
51 |
| - pyv: "3.10" |
| 26 | + pyv: ["3.8", "3.9", "3.10", "3.11"] |
| 27 | + |
52 | 28 | steps:
|
53 |
| - - uses: actions/checkout@v2.4.0 |
| 29 | + - uses: actions/checkout@v3 |
54 | 30 | with:
|
55 | 31 | fetch-depth: 0
|
| 32 | + |
56 | 33 | - name: Set up Python
|
57 |
| - uses: actions/setup-python@v2.2.2 |
| 34 | + uses: actions/setup-python@v4 |
58 | 35 | with:
|
59 | 36 | python-version: ${{ matrix.pyv }}
|
60 |
| - - name: get pip cache dir |
61 |
| - id: pip-cache-dir |
62 |
| - run: | |
63 |
| - echo "::set-output name=dir::$(pip cache dir)" |
64 |
| - - name: set pip cache |
65 |
| - id: pip-cache |
66 |
| - uses: actions/cache@v2.1.6 |
67 |
| - with: |
68 |
| - path: ${{ steps.pip-cache-dir.outputs.dir }} |
69 |
| - key: ${{ runner.os }}-pip-${{ hashFiles('setup.cfg') }} |
70 |
| - restore-keys: | |
71 |
| - ${{ runner.os }}-pip- |
| 37 | + cache: 'pip' |
| 38 | + cache-dependency-path: setup.cfg |
| 39 | + |
72 | 40 | - name: install
|
73 |
| - if: steps.cache.pip-cache-dir.cache-hit != 'true' |
74 | 41 | run: |
|
75 |
| - pip install --upgrade pip setuptools wheel |
| 42 | + pip install --upgrade pip wheel |
76 | 43 | pip install -e ".[tests]"
|
77 |
| - pip install "dvc[testing]@git+https://github.com/iterative/dvc" |
78 |
| - - name: setup git |
79 |
| - run: | |
80 |
| - git config --global user.email "dvctester@example.com" |
81 |
| - git config --global user.name "DVC Tester" |
| 44 | + pip install "dvc[testing] @ git+https://github.com/iterative/dvc" |
| 45 | +
|
| 46 | + - name: lint |
| 47 | + timeout-minutes: 10 |
| 48 | + uses: pre-commit/action@v3.0.0 |
| 49 | + |
82 | 50 | - name: run tests
|
83 |
| - timeout-minutes: 40 |
| 51 | + timeout-minutes: 15 |
84 | 52 | run: pytest -v -n=auto --cov-report=xml --cov-report=term
|
| 53 | + |
85 | 54 | - name: upload coverage report
|
86 | 55 | uses: codecov/codecov-action@v2.1.0
|
87 | 56 | with:
|
|
0 commit comments