Fix disk space problem installing python libraries in clu workflow #1827
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 workflow will install Python dependencies, run tests and lint. | |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
| name: Build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - 'test_*' | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.10', '3.11'] | |
| steps: | |
| - name: Cancel previous | |
| uses: styfle/cancel-workflow-action@0.8.0 | |
| with: | |
| access_token: ${{ github.token }} | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Clean pip cache | |
| run: pip cache purge | |
| - name: Check disk space | |
| run: df -h | |
| - name: Install dependencies | |
| run: | | |
| pip install . | |
| pip install .[test] | |
| - name: Test with pytest and generate coverage report | |
| run: | | |
| pytest . | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v1 | |
| with: | |
| file: ./coverage.xml |