Add Optimizer Accumulation #44
Workflow file for this run
This file contains 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
name: CI | |
on: | |
workflow_dispatch: | |
push: | |
paths: [ 'optimi/**', 'tests/**' ] | |
pull_request: | |
paths: [ 'optimi/**', 'tests/**' ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
py: ['3.8', '3.9', '3.10', '3.11'] | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.py }} | |
architecture: 'x64' | |
cache: "pip" | |
cache-dependency-path: pyproject.toml | |
- name: Install Library | |
run: | | |
pip install --upgrade pip | |
pip install .[test] --extra-index-url https://download.pytorch.org/whl/cpu | |
- name: Ruff Check | |
id: ruff | |
run: | | |
ruff check --output-format=github . | |
ruff format --check . | |
- name: Run Tests | |
id: pytest | |
run: | | |
REPORT="$(mktemp)" | |
echo "report-path=$REPORT" >> $GITHUB_OUTPUT | |
pytest -v -m cpu --md=$REPORT | |
# Modified from https://github.com/pavelzw/pytest-action, MIT License | |
- name: Add report to summary | |
run: | | |
echo "::group::..." | |
FINAL_REPORT="$(mktemp)" | |
echo "# Pytest Report" > "$FINAL_REPORT" | |
echo "<details><summary>Click to expand!</summary>" >> "$FINAL_REPORT" | |
tail -n+2 "${{ steps.pytest.outputs.report-path }}" >> "$FINAL_REPORT" | |
echo "</details>" >> "$FINAL_REPORT" | |
cat "$FINAL_REPORT" >> "$GITHUB_STEP_SUMMARY" | |
echo "::endgroup::" | |
echo | |
echo "=====================================================================================" | |
echo Markdown summaries: "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" | |
echo "=====================================================================================" |