--- name: Linting on: pull_request: push: branches: - master jobs: pre-commit-ci: name: Pre-Commit runs-on: [self-hosted, Linux, x64] env: PYTHON_VERSION: "3.10" steps: - name: Check out the codebase uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # 3.0.2 - name: Set up Python ${{ env.PYTHON_VERSION }} uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984 # 4.3.0 with: python-version: ${{ env.PYTHON_VERSION }} cache: 'pip' # caching pip dependencies - name: Install dependencies run: | echo "::group::Upgrade pip" python3 -m pip install --upgrade pip echo "::endgroup::" echo "::group::Install Python requirements from requirements.txt" python3 -m pip install -r requirements.txt echo "::endgroup::" echo "::group::Install Ansible role requirements from collections/requirements.yml" ansible-galaxy install -r collections/requirements.yml echo "::endgroup::" - name: Run pre-commit uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507 # 3.0.0