--- name: Python on: push: branches: [ "master", "main" ] paths: - 'pyproject.toml' - '**.py' - '.github/workflows/python-testing.yml' pull_request: branches: [ "master", "main" ] paths: - 'pyproject.toml' - '**.py' - '.github/workflows/python-testing.yml' permissions: contents: read concurrency: # only cancel in-progress runs of the same workflow group: ${{ github.workflow }}-${{ github.ref }} # ${{ github.head_ref || github.run_id }} cancel-in-progress: true jobs: check: runs-on: ubuntu-latest # Timout of 15min timeout-minutes: 15 steps: - uses: actions/checkout@v3 - name: Output env variables run: | echo "Default branch=${default-branch}" echo "GITHUB_WORKFLOW=${GITHUB_WORKFLOW}" echo "GITHUB_ACTION=$GITHUB_ACTION" echo "GITHUB_ACTIONS=$GITHUB_ACTIONS" echo "GITHUB_ACTOR=$GITHUB_ACTOR" echo "GITHUB_REPOSITORY=$GITHUB_REPOSITORY" echo "GITHUB_EVENT_NAME=$GITHUB_EVENT_NAME" echo "GITHUB_EVENT_PATH=$GITHUB_EVENT_PATH" echo "GITHUB_WORKSPACE=$GITHUB_WORKSPACE" echo "GITHUB_SHA=$GITHUB_SHA" echo "GITHUB_REF=$GITHUB_REF" echo "GITHUB_HEAD_REF=$GITHUB_HEAD_REF" echo "GITHUB_BASE_REF=$GITHUB_BASE_REF" echo "::debug::---Start content of file $GITHUB_EVENT_PATH" cat $GITHUB_EVENT_PATH echo "\n" echo "::debug::---end" - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v3 with: python-version: 3.8 cache: 'pip' - name: Install dependencies run: | python3 -m pip install --upgrade pip setuptools setuptools-scm pip install tox tox-gh-actions - name: Check run: | tox -e checks tests: needs: check runs-on: ubuntu-latest strategy: max-parallel: 5 matrix: python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", # "3.12-dev" ] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} cache: 'pip' - name: Install dependencies run: | python3 -m pip install --upgrade pip pip install tox tox-gh-actions - name: Test with tox run: | tox