-
Notifications
You must be signed in to change notification settings - Fork 2.2k
74 lines (60 loc) · 2.22 KB
/
pytest_cpu_gha_runner.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: "[GHA][CPU] llama-recipes Pytest tests on CPU GitHub hosted runner."
on:
pull_request:
branches:
- 'main'
# triggers workflow manually for debugging purposes.
workflow_dispatch:
inputs:
runner:
description: 'GHA Runner Scale Set label to run workflow on.'
required: true
default: ubuntu-20.04
debug:
description: 'Run debugging steps?'
required: false
default: "true"
env:
PYTORCH_WHEEL_URL: https://download.pytorch.org/whl/test/cu118
jobs:
execute_workflow:
name: Execute workload on GHA CPU Runner
defaults:
run:
shell: bash # default shell to run all steps for a given job.
runs-on: ${{ github.event.inputs.runner != '' && github.event.inputs.runner || 'ubuntu-20.04' }}
steps:
- name: "[DEBUG] Get runner container OS information"
id: os_info
if: ${{ github.event.inputs.debug == 'true' }}
run: |
cat /etc/os-release
- name: "Checkout 'facebookresearch/llama-recipes' repository"
id: checkout
uses: actions/checkout@v4
- name: "[DEBUG] Content of the repository after checkout"
id: content_after_checkout
if: ${{ github.event.inputs.debug == 'true' }}
run: |
ls -la ${GITHUB_WORKSPACE}
- name: "Installing Python dependencies"
id: python_dependencies
run: |
pip3 install --upgrade pip
pip3 install setuptools
- name: "Installing 'llama-recipes' project"
id: install_llama_recipes_package
run: |
echo "Installing 'llama-recipes' project (re: https://github.com/facebookresearch/llama-recipes?tab=readme-ov-file#install-with-optional-dependencies)"
pip install --extra-index-url ${PYTORCH_WHEEL_URL} -e '.[tests]'
- name: "Running PyTest tests on GHA CPU Runner"
id: pytest
run: |
echo "Running PyTest tests at 'GITHUB_WORKSPACE' path: ${GITHUB_WORKSPACE}"
cd $GITHUB_WORKSPACE && python3 -m pytest --junitxml="$GITHUB_WORKSPACE/result.xml"
- name: Publish Test Summary
id: test_summary
uses: test-summary/action@v2
with:
paths: "**/*.xml"
if: always()