Skip to content

Commit

Permalink
Fix #1244, fixes the github action to run from the PR branch
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsuresh committed Jun 8, 2024
1 parent 596dba4 commit a620c9e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 29 deletions.
35 changes: 7 additions & 28 deletions .github/workflows/test-cm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,24 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
on: [ubuntu-latest]
on: [ubuntu-latest, windows-latest]
runs-on: "${{ matrix.on }}"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- name: Install dependencies and test cm pull repo
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -r requirements.txt
python -m pip install --ignore-installed --verbose pip setuptools
cd cm
python setup.py install
python -m pip install .
python -m cmind
# cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }}
cm pull repo mlcommons@cm4mlops --branch=mlperf-inference
Expand All @@ -46,26 +48,3 @@ jobs:
run: |
python tests/test_cm.py
test_cm:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
on: [ubuntu-latest, windows-latest]
runs-on: "${{ matrix.on }}"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install cmind
# cm pull repo --url=${{ github.event.pull_request.head.repo.html_url }} --checkout=${{ github.event.pull_request.head.ref }}
cm pull repo mlcommons@cm4mlops --branch=mlperf-inference
- name: Test CM
run: |
python tests/test_cm.py
2 changes: 1 addition & 1 deletion cm/cmind/repos.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ def pull(self, alias, url = '', branch = '', checkout = '', console = False, des
extra_flag = ' ' if checkout_only else ' -b '

if branch != '':
cmd += extra_flag + branch
cmd = 'git fetch && git switch ' + branch

if checkout!='':
cmd += ' ' + checkout
Expand Down

0 comments on commit a620c9e

Please sign in to comment.