actions: bump actions/checkout from 5 to 6 #40
Workflow file for this run
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: Run pytest for not-slow tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| pull_request: | |
| branches: | |
| - main | |
| - master | |
| workflow_dispatch: # This allows us to manually trigger | |
| jobs: | |
| define-matrix: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| configurations: ${{ steps.matrix.outputs.configurations }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| # setting the configuration with the matrix facility of GH is a bit difficult | |
| # as different versions of python need different os, different packages need | |
| # different version of python, etc... at the end, it is a sparse matrix | |
| # We use a script that contains the logic instead, in this same folder | |
| # using vanilla python. | |
| - name: Define matrix | |
| id: matrix | |
| run: | | |
| # "$GITHUB_OUTPUT" will be a json file containing all the configurations | |
| python .github/workflows/build_matrix.py "$GITHUB_OUTPUT" | |
| # we need to prepend with the output name, maybe we can do that directly | |
| # in json? | |
| echo "configurations="`cat "$GITHUB_OUTPUT"` > "$GITHUB_OUTPUT" | |
| build: | |
| if: "!contains(github.event.head_commit.message, 'ci skip')" | |
| continue-on-error: true | |
| needs: define-matrix | |
| strategy: | |
| max-parallel: 4 | |
| fail-fast: false | |
| matrix: | |
| # reads the configuration from the previously defined file | |
| configuration: ${{ fromJSON(needs.define-matrix.outputs.configurations) }} | |
| runs-on: ${{ matrix.configuration.os }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.configuration.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.configuration.python-version }} | |
| cache: 'pip' # caching pip dependencies | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt ${{ matrix.configuration.packages }} | |
| pip list | |
| - name: Install package | |
| run: | | |
| pip install . | |
| - name: Lint with flake8 | |
| run: | | |
| pip install flake8 | |
| # stop the build if there are Python syntax errors | |
| # or undefined names | |
| # note: we cannot use line breaks "\" to split this up to several lines, as | |
| # windows uses "^" instead. | |
| flake8 --count --exclude .git,build,__pycache__ --select=E9,F63,F7,F82 --show-source --statistics . | |
| # exit-zero treats all errors as warnings. | |
| # The GitHub editor is 127 chars wide | |
| flake8 --count --exclude .git,build,__pycache__ --exit-zero --max-complexity=10 --max-line-length=127 --statistics . | |
| - name: Test with pytest | |
| run: | | |
| pip install pytest | |
| pytest -vv -m "not slow" |