-
Notifications
You must be signed in to change notification settings - Fork 307
Migrate CPU CI to GH #2587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
xiaoyu-work
wants to merge
8
commits into
main
Choose a base branch
from
xiaoyu/github-actions-cpu-ci
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+161
−19
Open
Migrate CPU CI to GH #2587
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d2768dd
Add GitHub Actions CPU CI
xiaoyu-work 8d75bb8
Simplify GitHub Actions CPU CI
xiaoyu-work b5bfc71
fix: use ignore_cleanup_errors=True in TemporaryDirectory to fix Wind…
Copilot 3f2a4fc
ci: add Show coverage report step before generating XML report
Copilot c2863f4
skip az ppl
xiaoyu-work 71fa17a
add comment trigger
xiaoyu-work 38c1a3c
Fix flaky ORT expectation in mnb_to_qdq test
Copilot d9ec61e
ci: add no-op Azure Pipeline job placeholder
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
| name: Olive CPU CI | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| issue_comment: | ||
| types: | ||
| - created | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event_name == 'issue_comment' && format('pr-{0}-{1}', github.event.issue.number, github.event.comment.id) || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: read | ||
| issues: read | ||
|
|
||
| jobs: | ||
| cpu_tests: | ||
| if: >- | ||
| github.event_name == 'push' || | ||
| github.event_name == 'workflow_dispatch' || | ||
| (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) || | ||
| ( | ||
| github.event_name == 'issue_comment' && | ||
| github.event.issue.pull_request != null && | ||
| contains(github.event.comment.body, '/ci run') && | ||
| ( | ||
| github.event.comment.author_association == 'OWNER' || | ||
| github.event.comment.author_association == 'MEMBER' || | ||
| github.event.comment.author_association == 'COLLABORATOR' | ||
| ) | ||
| ) | ||
| name: ${{ matrix.name }} CPU unit tests | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - name: Linux | ||
| os: ubuntu-22.04 | ||
| platform: linux | ||
| - name: Windows | ||
| os: windows-2022 | ||
| platform: windows | ||
| runs-on: ${{ matrix.os }} | ||
| timeout-minutes: 300 | ||
| env: | ||
| HF_HOME: ${{ github.workspace }}/.cache/huggingface | ||
| PYTHONIOENCODING: utf-8 | ||
| PYTHONUTF8: "1" | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.event_name == 'issue_comment' && format('refs/pull/{0}/merge', github.event.issue.number) || github.ref }} | ||
|
|
||
| - name: Setup Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
| cache: pip | ||
| cache-dependency-path: | | ||
| requirements.txt | ||
| test/requirements-test.txt | ||
| test/requirements-test-cpu.txt | ||
|
|
||
| - name: Install PyTorch | ||
| run: python -m pip install torch | ||
|
|
||
| - name: Install Olive | ||
| run: python -m pip install . | ||
|
|
||
| - name: Install ONNX Runtime | ||
| run: python -m pip install onnxruntime | ||
|
|
||
| - name: Install pytest | ||
| run: python -m pip install pytest | ||
|
|
||
| - name: Install test dependencies | ||
| run: python -m pip install -r test/requirements-test-cpu.txt | ||
|
|
||
| - name: List installed packages | ||
| run: python -m pip list | ||
|
|
||
| - name: Log in to Hugging Face | ||
| env: | ||
| HF_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }} | ||
| run: >- | ||
| python -c "import os; from huggingface_hub import login; | ||
| login(token=os.environ['HF_TOKEN'])" | ||
|
|
||
| - name: Create test output directory | ||
| run: python -c "from pathlib import Path; Path('logs').mkdir(exist_ok=True)" | ||
|
|
||
| - name: Run tests | ||
| run: >- | ||
| python -m coverage run --source=olive -m pytest -v -s -p no:warnings | ||
| --disable-warnings --log-cli-level=WARNING | ||
| --junitxml=logs/test-TestOlive-${{ matrix.platform }}.xml | ||
| -m "not openvino and not amd" test | ||
| --basetemp "${{ runner.temp }}/pytest" | ||
|
|
||
| - name: Show coverage report | ||
| if: always() | ||
| continue-on-error: true | ||
| run: python -m coverage report -m | ||
|
|
||
| - name: Generate coverage report | ||
|
xiaoyu-work marked this conversation as resolved.
|
||
| if: always() | ||
| continue-on-error: true | ||
| run: python -m coverage xml -o coverage-${{ matrix.platform }}.xml | ||
|
|
||
| - name: Upload test results | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: cpu-test-results-${{ matrix.platform }} | ||
| path: | | ||
| logs/*.xml | ||
| coverage-${{ matrix.platform }}.xml | ||
| if-no-files-found: warn | ||
| retention-days: 14 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.