github.com/drone/go-convert@v0.0.0-20240307072510-6bd371c65e61/convert/github/testdata/build-and-test/python.yaml (about) 1 # https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python 2 3 name: Python package 4 5 # on: [push] 6 7 jobs: 8 build: 9 10 runs-on: ubuntu-latest 11 strategy: 12 matrix: 13 python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] 14 15 steps: 16 - uses: actions/checkout@v3 17 - name: Set up Python ${{ matrix.python-version }} 18 uses: actions/setup-python@v4 19 with: 20 python-version: ${{ matrix.python-version }} 21 - name: Install dependencies 22 run: | 23 python -m pip install --upgrade pip 24 pip install ruff pytest 25 if [ -f requirements.txt ]; then pip install -r requirements.txt; fi 26 - name: Lint with ruff 27 run: | 28 # stop the build if there are Python syntax errors or undefined names 29 ruff --format=github --select=E9,F63,F7,F82 --target-version=py37 . 30 # default set of ruff rules with GitHub Annotations 31 ruff --format=github --target-version=py37 . 32 - name: Test with pytest 33 run: |- 34 pytest