pytorch-lightning

Форк
0
/
ci-tests-store.yml 
96 строк · 3.3 Кб
1
name: Test Store
2

3
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
4
on:
5
  push:
6
    branches: [master, "release/*"]
7
  pull_request:
8
    branches: [master, "release/*"]
9
    types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped
10
    paths:
11
      - ".actions/*"
12
      - "requirements/ci.txt"
13
      - "requirements/store/**"
14
      - "src/lightning/__init__.py"
15
      - "src/lightning/__setup__.py"
16
      - "src/lightning/__version__.py"
17
      - "src/lightning/store/**"
18
      - "tests/tests_store/**"
19
      - "pyproject.toml" # includes pytest config
20
      - ".github/workflows/ci-tests-store.yml"
21
      - "!requirements/*/docs.txt"
22
      - "!*.md"
23
      - "!**/*.md"
24

25
concurrency:
26
  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
27
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}
28

29
defaults:
30
  run:
31
    shell: bash
32

33
jobs:
34
  store-cpu:
35
    runs-on: ${{ matrix.os }}
36
    if: github.event.pull_request.draft == false
37
    strategy:
38
      fail-fast: false
39
      matrix:
40
        os: ["macOS-11", "ubuntu-20.04", "windows-2022"]
41
        pkg-name: ["lightning"]
42
        python-version: ["3.10"]
43
        pytorch-version: ["2.0"]
44
    timeout-minutes: 25 # because of building grpcio on Mac
45
    env:
46
      PACKAGE_NAME: ${{ matrix.pkg-name }}
47
      FREEZE_REQUIREMENTS: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
48
      # PYPI_CACHE_DIR: "_pip-wheels"
49
      TORCH_URL_STABLE: "https://download.pytorch.org/whl/cpu/torch_stable.html"
50
    steps:
51
      - uses: actions/checkout@v4
52

53
      - name: Set up Python ${{ matrix.python-version }}
54
        uses: actions/setup-python@v5
55
        with:
56
          python-version: ${{ matrix.python-version }}
57

58
      - name: Adjust PyTorch versions in requirements files
59
        if: ${{ matrix.requires != 'oldest' && matrix.release != 'pre' }}
60
        run: |
61
          pip install -q -r requirements/ci.txt
62
          python -m wget https://raw.githubusercontent.com/Lightning-AI/utilities/main/scripts/adjust-torch-versions.py
63
          for fpath in `ls requirements/store/*.txt`; do \
64
            python ./adjust-torch-versions.py $fpath ${{ matrix.pytorch-version }}; \
65
          done
66

67
      - name: Install package & dependencies
68
        timeout-minutes: 20
69
        run: |
70
          pip install -e ".[store,store-test]" -U -f ${TORCH_URL} --prefer-binary
71
          pip list
72

73
      - name: Testing Store
74
        working-directory: tests/tests_store
75
        # NOTE: do not include coverage report here, see: https://github.com/nedbat/coveragepy/issues/1003
76
        run: |
77
          python -m coverage run --source lightning \
78
            -m pytest -v --timeout=60 --durations=60
79

80
      - name: Statistics
81
        if: success()
82
        working-directory: tests/tests_store
83
        run: |
84
          coverage report
85
          coverage xml
86

87
      - name: Upload coverage to Codecov
88
        uses: codecov/codecov-action@v4
89
        # see: https://github.com/actions/toolkit/issues/399
90
        continue-on-error: true
91
        with:
92
          token: ${{ secrets.CODECOV_TOKEN }}
93
          file: tests/tests_store/coverage.xml
94
          flags: lightning,cpu,pytest,python${{ matrix.python-version }}
95
          name: CPU-coverage
96
          fail_ci_if_error: false
97

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.