|
1 | 1 | name: CI |
2 | 2 |
|
3 | 3 | on: |
4 | | - # GitHub has started calling new repo's first branch "main" https://github.com/github/renaming |
5 | | - # Existing codes likely still have "master" as the primary branch |
6 | | - # Both are tracked here to keep legacy and new codes working |
7 | | - push: |
8 | | - branches: |
9 | | - - "master" |
10 | | - - "main" |
11 | | - pull_request: |
12 | | - branches: |
13 | | - - "master" |
14 | | - - "main" |
15 | | - schedule: |
16 | | - # Nightly tests run on master by default: |
17 | | - # Scheduled workflows run on the latest commit on the default or base branch. |
18 | | - # (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule) |
19 | | - - cron: "0 0 * * *" |
| 4 | + # GitHub has started calling new repo's first branch "main" https://github.com/github/renaming |
| 5 | + # Existing codes likely still have "master" as the primary branch |
| 6 | + # Both are tracked here to keep legacy and new codes working |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - "master" |
| 10 | + - "main" |
| 11 | + pull_request: |
| 12 | + branches: |
| 13 | + - "master" |
| 14 | + - "main" |
| 15 | + schedule: |
| 16 | + # Nightly tests run on master by default: |
| 17 | + # Scheduled workflows run on the latest commit on the default or base branch. |
| 18 | + # (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule) |
| 19 | + - cron: "0 0 * * *" |
20 | 20 |
|
21 | 21 | jobs: |
22 | | - test: |
23 | | - name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }} |
24 | | - runs-on: ${{ matrix.os }} |
25 | | - strategy: |
26 | | - matrix: |
27 | | - os: [ubuntu-latest] |
28 | | - python-version: ["3.10", "3.11", "3.12"] |
29 | | - |
30 | | - steps: |
31 | | - - uses: actions/checkout@v4 |
32 | | - |
33 | | - - name: Infos |
34 | | - shell: bash |
35 | | - run: | |
36 | | - uname -a |
37 | | - df -h |
38 | | - ulimit -a |
39 | | -
|
40 | | -
|
41 | | - # More info on options: https://github.com/conda-incubator/setup-miniconda |
42 | | - - uses: conda-incubator/setup-miniconda@v3 |
43 | | - with: |
44 | | - python-version: ${{ matrix.python-version }} |
45 | | - environment-file: devtools/conda-envs/gninatorch-CI.yaml |
46 | | - mamba-version: "*" |
47 | | - channels: pytorch,conda-forge |
48 | | - channel-priority: true |
49 | | - activate-environment: gninatorch |
50 | | - auto-update-conda: false |
51 | | - auto-activate-base: false |
52 | | - show-channel-urls: true |
53 | | - |
54 | | - - name: Install package |
55 | | - |
56 | | - # conda setup requires this special shell |
57 | | - shell: bash -l {0} |
58 | | - run: | |
59 | | - python -m pip install . --no-deps |
60 | | - conda list |
61 | | -
|
62 | | -
|
63 | | - - name: Run tests |
64 | | - |
65 | | - # conda setup requires this special shell |
66 | | - shell: bash -l {0} |
67 | | - |
68 | | - run: | |
69 | | - pytest -v --cov=gninatorch --cov-report=xml --color=yes tests/ --nogpu |
70 | | -
|
71 | | - - name: CodeCov |
72 | | - uses: codecov/codecov-action@v5 |
73 | | - with: |
74 | | - files: ./coverage.xml |
75 | | - flags: unittests |
76 | | - name: codecov-${{ matrix.os }}-py${{ matrix.python-version }} |
| 22 | + test: |
| 23 | + name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }} |
| 24 | + runs-on: ${{ matrix.os }} |
| 25 | + strategy: |
| 26 | + matrix: |
| 27 | + os: [ubuntu-latest] |
| 28 | + python-version: ["3.12", "3.13"] |
| 29 | + |
| 30 | + steps: |
| 31 | + - uses: actions/checkout@v4 |
| 32 | + with: |
| 33 | + fetch-depth: 0 |
| 34 | + |
| 35 | + - name: Infos |
| 36 | + shell: bash |
| 37 | + run: | |
| 38 | + uname -a |
| 39 | + df -h |
| 40 | + ulimit -a |
| 41 | +
|
| 42 | + - name: Install uv |
| 43 | + uses: astral-sh/setup-uv@v7 |
| 44 | + with: |
| 45 | + python-version: ${{ matrix.python-version }} |
| 46 | + enable-cache: true |
| 47 | + cache-dependency-glob: "pyproject.toml" |
| 48 | + |
| 49 | + - name: Install package |
| 50 | + run: uv sync --extra all --extra test |
| 51 | + |
| 52 | + - name: Run tests |
| 53 | + run: uv run pytest -v --cov=gninatorch --cov-report=xml --color=yes tests/ --nogpu |
| 54 | + |
| 55 | + - name: CodeCov |
| 56 | + uses: codecov/codecov-action@v5 |
| 57 | + with: |
| 58 | + files: ./coverage.xml |
| 59 | + flags: unittests |
| 60 | + name: codecov-${{ matrix.os }}-py${{ matrix.python-version }} |
0 commit comments