diff --git a/.github/workflows/backend_checks.yml b/.github/workflows/backend_checks.yml index e1cc215070..065a8ef920 100644 --- a/.github/workflows/backend_checks.yml +++ b/.github/workflows/backend_checks.yml @@ -75,43 +75,6 @@ jobs: path: /tmp/python-${{ matrix.python_version }}.tar retention-days: 1 - ################### - ## Static Checks ## - ################### - Static-Checks: - strategy: - matrix: - session_name: - [ - '"isort(check)"', - '"black(check)"', - "mypy", - "pylint", - "xenon", - "check_install", - '"pytest(nox)"', - ] - runs-on: ubuntu-latest - continue-on-error: true - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set Up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ env.DEFAULT_PYTHON_VERSION }} - cache: "pip" - - - name: Install Nox - run: pip install nox>=2022 - - - name: Install Dev Requirements - run: pip install -r dev-requirements.txt - - - name: Run Static Check - run: nox -s ${{ matrix.session_name }} - ################## ## Performance ## ################## diff --git a/.github/workflows/static_checks.yml b/.github/workflows/static_checks.yml new file mode 100644 index 0000000000..8a26cfb6ff --- /dev/null +++ b/.github/workflows/static_checks.yml @@ -0,0 +1,53 @@ +name: Backend Static Code Checks + +on: + pull_request: + push: + branches: + - "main" + - "release-**" + +env: + IMAGE: ethyca/fides:local + DEFAULT_PYTHON_VERSION: "3.10.13" + # Docker auth with read-only permissions. + DOCKER_USER: ${{ secrets.DOCKER_USER }} + DOCKER_RO_TOKEN: ${{ secrets.DOCKER_RO_TOKEN }} + +jobs: + ################### + ## Static Checks ## + ################### + Static-Checks: + strategy: + matrix: + session_name: + [ + '"isort(check)"', + '"black(check)"', + "mypy", + "pylint", + "xenon", + "check_install", + '"pytest(nox)"', + ] + runs-on: ubuntu-latest + continue-on-error: true + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set Up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.DEFAULT_PYTHON_VERSION }} + cache: "pip" + + - name: Install Nox + run: pip install nox>=2022 + + - name: Install Dev Requirements + run: pip install -r dev-requirements.txt + + - name: Run Static Check + run: nox -s ${{ matrix.session_name }} diff --git a/noxfiles/ci_nox.py b/noxfiles/ci_nox.py index d18428ee1d..8b835376a2 100644 --- a/noxfiles/ci_nox.py +++ b/noxfiles/ci_nox.py @@ -95,13 +95,19 @@ def xenon(session: nox.Session) -> None: "src", "tests", "scripts", - "--max-absolute B", - "--max-modules B", - "--max-average A", - "--ignore 'data, docs'", - "--exclude src/fides/_version.py", + "--max-absolute=B", + "--max-modules=B", + "--max-average=A", + "--ignore=data,docs", + "--exclude=src/fides/_version.py", + ) + session.run(*command, success_codes=[0, 1]) + session.warn( + "Note: This command was malformed so it's been failing to report complexity issues." + ) + session.warn( + "Intentionally suppressing the error status code for now to slowly work through the issues." ) - session.run(*command) ##################