Update tutorials with latest changes #81
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
| name: Test build and install upon Python 3.9 to 3.11 | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| pull_request: | |
| branches: | |
| - '**' | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.9', '3.10', '3.11'] | |
| max-parallel: 1 # Limit to one job at a time | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 1 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Check Python version | |
| run: python --version | |
| - name: Free up space | |
| run: | | |
| sudo apt-get clean | |
| sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc | |
| - name: Cache pip dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip-${{ matrix.python-version }} | |
| ${{ runner.os }}-pip | |
| - name: Check disk space before install | |
| run: df -h | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install poetry tox | |
| - name: Install PyTorch | |
| run: pip install torch==2.4.1 --index-url https://download.pytorch.org/whl/cpu | |
| - name: Install project dependencies | |
| run: | | |
| poetry lock | |
| poetry install --only main -v | |
| - name: Clean dist directory | |
| run: rm -rf dist/* | |
| - name: Build package | |
| run: poetry build | |
| - name: Install package | |
| run: pip install dist/*.whl | |
| - name: Verify package installation | |
| run: python -c 'import construct_tracker; print("Package imported successfully")' | |
| - name: Run tox | |
| run: | | |
| python_version=$(echo ${{ matrix.python-version }} | sed 's/\.//g') | |
| tox -e py${python_version} | |
| # - name: Check disk space after install | |
| # run: df -h | |
| # publish: | |
| # needs: test | |
| # runs-on: ubuntu-latest | |
| # if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| # | |
| # steps: | |
| # - name: Checkout code | |
| # uses: actions/checkout@v2 | |
| # | |
| # - name: Set up Python | |
| # uses: actions/setup-python@v4 | |
| # with: | |
| # python-version: 3.11 | |
| # | |
| # - name: Install dependencies | |
| # run: | | |
| # python -m pip install --upgrade pip | |
| # pip install poetry | |
| # | |
| # - name: Build and publish to PyPI | |
| # env: | |
| # TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
| # TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
| # run: | | |
| # poetry build | |
| # pip install twine | |
| # twine upload dist/* |