use github-hosted CI runner (#1099) #2940
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. | |
| # For more information see: | |
| # https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
| name: tests | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.12"] | |
| steps: | |
| - name: Checkout github repo (+ download lfs dependencies) | |
| uses: actions/checkout@v3 | |
| with: | |
| lfs: true | |
| - name: Free up disk space | |
| run: | | |
| sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc | |
| df -h | |
| - name: Install fftw3 | |
| run: sudo apt-get install libfftw3-dev | |
| - name: Install poetry | |
| run: pipx install poetry | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Create environment variables | |
| run: | | |
| echo "JUPYTER_PLATFORM_DIRS=1" >> $GITHUB_ENV | |
| echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | |
| - name: Install poetry dependencies | |
| run: poetry install --sync | |
| - name: Run black | |
| run: poetry run black --check . | |
| - name: Run flake8 | |
| run: poetry run flake8 bliss/ tests/ case_studies/ | |
| - name: Run pylint | |
| run: poetry run pylint bliss/ tests/ case_studies/ | |
| - name: Run darglint | |
| run: poetry run darglint bliss/ tests/ | |
| - name: Run Tests on the CPU | |
| run: poetry run pytest --cov=./bliss --cov-report=xml --durations=0 | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage.xml | |
| flags: unittests | |
| env_vars: OS,PYTHON | |
| name: codecov-umbrella | |
| fail_ci_if_error: true |