forked from mosaicml/composer
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (71 loc) · 2.29 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
66
67
68
69
70
71
72
73
74
name: Pytest CPU
on:
workflow_call:
inputs:
composer_package_name:
required: true
type: string
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
export COMPOSER_PACKAGE_NAME='${{ inputs.composer_package_name }}'
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 WANDB_API_KEY='${{ secrets.wandb-api-key }}'
export WANDB_ENTITY='${{ inputs.pytest-wandb-entity }}'
export WANDB_PROJECT='${{ inputs.pytest-wandb-project }}'
export AWS_ACCESS_KEY_ID='${{ secrets.aws-access-key-id }}'
export AWS_SECRET_ACCESS_KEY='${{ secrets.aws-secret-access-key }}'
export S3_BUCKET='${{ inputs.pytest-s3-bucket }}'
export COMMON_ARGS="-v --durations=20 -m '${{ inputs.pytest-markers }}' --s3_bucket '$S3_BUCKET'"
# Necessary to run git diff for doctests
git config --global --add safe.directory /__w/composer/composer
make test PYTEST='${{ inputs.pytest-command }}' EXTRA_ARGS="$COMMON_ARGS --codeblocks"
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