-
Notifications
You must be signed in to change notification settings - Fork 70
65 lines (62 loc) · 1.75 KB
/
pytest-cpu.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Pytest CPU
on:
workflow_call:
inputs:
container:
required: true
type: string
name:
required: true
type: string
pytest-command:
required: true
type: string
pytest-markers:
required: true
type: string
pytest-s3-bucket:
required: false
type: string
pytest-wandb-entity:
required: false
type: string
pytest-wandb-project:
required: false
type: string
secrets:
wandb-api-key:
required: false
aws-access-key-id:
required: false
aws-secret-access-key:
required: false
jobs:
pytest-cpu:
timeout-minutes: 30
runs-on: ubuntu-latest
container: ${{ inputs.container }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup
run: |
set -ex
export PATH=/composer-python:$PATH
python -m pip install --upgrade 'pip<23' wheel
python -m pip install --upgrade .[all]
- name: Run Tests
id: tests
run: |
set -ex
export PATH=/composer-python:$PATH
export COMMON_ARGS="-v --durations=20 -m '${{ inputs.pytest-markers }}'"
# Necessary to run git diff for doctests
git config --global --add safe.directory /__w/diffusion2/diffusion
make test PYTEST='${{ inputs.pytest-command }}' EXTRA_ARGS="$COMMON_ARGS"
make test-dist PYTEST='${{ inputs.pytest-command }}' EXTRA_ARGS="$COMMON_ARGS" WORLD_SIZE=2
python -m coverage combine
- uses: actions/upload-artifact@v3
with:
name: coverage-${{ github.sha }}-${{ inputs.name }}
path: .coverage
include-hidden-files: true