From a578b0a633f3f436c42b620caed863346a797c86 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Tue, 26 Nov 2024 18:21:28 -0500 Subject: [PATCH] ci: Reuse workflow for lint --- .github/workflows/lint.yml | 43 +++++++------------------------------- 1 file changed, 7 insertions(+), 36 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 73a3bc27..3873b19a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,39 +1,10 @@ name: Lint on: [push, pull_request] -env: - BASEDIR: https://raw.githubusercontent.com/open-contracting/standard-maintenance-scripts/main jobs: - build: - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository - runs-on: ubuntu-latest - env: - PAT: ${{ secrets.PAT }} - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.PAT || github.token }} - - uses: actions/setup-python@v5 - with: - python-version: '3.11' - cache: pip - cache-dependency-path: '**/requirements*.txt' - - id: changed-files - uses: tj-actions/changed-files@v45 - - uses: pre-commit/action@v3.0.1 - continue-on-error: true - with: - extra_args: pip-compile --files ${{ steps.changed-files.outputs.all_changed_files }} - - if: ${{ env.PAT }} - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_message: '[github-actions] pre-commit autoupdate' - - shell: bash - run: curl -s -S --retry 3 $BASEDIR/tests/install.sh | bash - - - shell: bash - run: curl -s -S --retry 3 $BASEDIR/tests/script.sh | bash - - - run: pip install -r requirements_dev.txt - - env: - # https://fastapi.tiangolo.com/tutorial/request-files/ - # babel and uvicorn are run as commands in a Dockerfile. - STANDARD_MAINTENANCE_SCRIPTS_IGNORE: babel,python-multipart,uvicorn - run: pytest /tmp/test_requirements.py + lint: + uses: open-contracting/.github/.github/workflows/lint.yml@main + permissions: + contents: write + # https://fastapi.tiangolo.com/tutorial/request-files/ + # babel and uvicorn are run as commands in a Dockerfile. + standard-maintenance-scripts-ignore: babel,python-multipart,uvicorn