From 8ec21fb787174111bbdc60300fbc262ae935047c Mon Sep 17 00:00:00 2001 From: mshriver Date: Tue, 17 Dec 2024 10:11:16 -0500 Subject: [PATCH] Move eslint to github action, remove from precommit --- .github/workflows/tests.yaml | 43 +++++++++++++++++++----------------- .pre-commit-config.yaml | 20 +---------------- frontend/.nvmrc | 1 + 3 files changed, 25 insertions(+), 39 deletions(-) create mode 100644 frontend/.nvmrc diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index a7efd092..402ab4a1 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -3,7 +3,7 @@ name: Ibutsu tests on: push: branches: - - master + - main pull_request: types: ["opened", "synchronize", "reopened"] create: @@ -12,12 +12,27 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 - name: Install dependencies run: pip install pre-commit - name: Run pre-commit run: pre-commit run --all --verbose + lint-test-frontend: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: 'frontend/.nvmrc' + cache: 'yarn' + cache-dependency-path: 'frontend/yarn.lock' + - run: yarn install --frozen-lockfile + working-directory: ./frontend + - run: yarn lint + working-directory: ./frontend + - run: yarn test + working-directory: ./frontend test-backend: runs-on: ubuntu-latest needs: lint @@ -25,8 +40,8 @@ jobs: matrix: python-version: [ "3.9", "3.10", "3.11"] # five is broken on 3.11 - celery update needed "3.11.0-alpha - 3.11"] steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install backend dependencies with Python ${{ matrix.python-version }} @@ -37,18 +52,6 @@ jobs: - name: Run backend tests working-directory: ./backend run: pytest - test-frontend: - runs-on: ubuntu-latest - needs: lint - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - - name: Install frontend dependencies - working-directory: ./frontend - run: yarn install - - name: Run frontend tests - working-directory: ./frontend - run: yarn test build-backend: runs-on: ubuntu-latest @@ -57,7 +60,7 @@ jobs: matrix: app: [backend, scheduler, worker] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build image ${{ matrix.app }} uses: redhat-actions/buildah-build@v2 with: @@ -68,9 +71,9 @@ jobs: build-frontend: runs-on: ubuntu-latest - needs: test-frontend + needs: lint-test-frontend steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build frontend image uses: redhat-actions/buildah-build@v2 with: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d8377210..84566736 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ repos: - id: debug-statements - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.0 + rev: v0.8.2 hooks: - id: ruff args: @@ -28,21 +28,3 @@ repos: rev: v2.12.1b3 hooks: - id: hadolint - -## ES -- repo: https://github.com/pre-commit/mirrors-eslint - rev: v9.13.0 - hooks: - - id: eslint - additional_dependencies: - - eslint@7 - - eslint-plugin-cypress - - eslint-plugin-react - - eslint-plugin-import - - "@babel/eslint-parser" - - "@babel/plugin-transform-class-properties" - - "@babel/plugin-transform-private-methods" - - "@babel/plugin-syntax-jsx" - - "@babel/preset-flow" - - "@babel/core" - - "react" diff --git a/frontend/.nvmrc b/frontend/.nvmrc new file mode 100644 index 00000000..3f430af8 --- /dev/null +++ b/frontend/.nvmrc @@ -0,0 +1 @@ +v18