diff --git a/.circleci/config.yml b/.circleci/config.yml index 24119bc75..2e7012cb8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,132 +15,6 @@ defaults: &defaults LOG_LEVEL: warn jobs: - # Separate job for linting (no parallelism needed) - lint: - <<: *defaults - steps: - - checkout - - # Install minimal system dependencies for linting - - run: - name: Install System Dependencies - command: | - sudo apt-get update - DEBIAN_FRONTEND=noninteractive sudo apt-get install -y \ - libpq-dev \ - build-essential \ - git \ - curl \ - libssl-dev \ - zlib1g-dev \ - libreadline-dev \ - libyaml-dev \ - openjdk-11-jdk \ - jq \ - software-properties-common \ - ca-certificates \ - imagemagick \ - libxml2-dev \ - libxslt1-dev \ - file \ - g++ \ - gcc \ - autoconf \ - gnupg2 \ - patch \ - ruby-dev \ - liblzma-dev \ - libgmp-dev \ - libncurses5-dev \ - libffi-dev \ - libgdbm6 \ - libgdbm-dev \ - libvips - - - run: - name: Install RVM and Ruby 3.4.4 - command: | - sudo apt-get install -y gpg - gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB - \curl -sSL https://get.rvm.io | bash -s stable - echo 'source ~/.rvm/scripts/rvm' >> $BASH_ENV - source ~/.rvm/scripts/rvm - rvm install "3.4.4" - rvm use 3.4.4 --default - gem install bundler -v 2.5.16 - - - run: - name: Install Application Dependencies - command: | - source ~/.rvm/scripts/rvm - bundle install - - - node/install: - node-version: '23.7' - - node/install-pnpm - - node/install-packages: - pkg-manager: pnpm - override-ci-command: pnpm i - - # Swagger verification - - run: - name: Verify swagger API specification - command: | - bundle exec rake swagger:build - if [[ `git status swagger/swagger.json --porcelain` ]] - then - echo "ERROR: The swagger.json file is not in sync with the yaml specification. Run 'rake swagger:build' and commit 'swagger/swagger.json'." - exit 1 - fi - mkdir -p ~/tmp - curl -L https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.3.0/openapi-generator-cli-6.3.0.jar > ~/tmp/openapi-generator-cli-6.3.0.jar - java -jar ~/tmp/openapi-generator-cli-6.3.0.jar validate -i swagger/swagger.json - - # Bundle audit - - run: - name: Bundle audit - command: bundle exec bundle audit update && bundle exec bundle audit check -v - - # Rubocop linting - - run: - name: Rubocop - command: bundle exec rubocop --parallel - - # ESLint linting - - run: - name: eslint - command: pnpm run eslint - - # Separate job for frontend tests - frontend-tests: - <<: *defaults - steps: - - checkout - - node/install: - node-version: '23.7' - - node/install-pnpm - - node/install-packages: - pkg-manager: pnpm - override-ci-command: pnpm i - - - run: - name: Run frontend tests (with coverage) - command: pnpm run test:coverage - - - run: - name: Move coverage files if they exist - command: | - if [ -d "coverage" ]; then - mkdir -p ~/build/coverage - cp -r coverage ~/build/coverage/frontend || true - fi - when: always - - - persist_to_workspace: - root: ~/build - paths: - - coverage - # Backend tests with parallelization backend-tests: <<: *defaults @@ -327,7 +201,7 @@ jobs: paths: - coverage - # Collect coverage from all jobs + # Collect coverage from backend tests coverage: <<: *defaults steps: @@ -335,11 +209,6 @@ jobs: - attach_workspace: at: ~/build - # Qlty coverage publish - - qlty-orb/coverage_publish: - files: | - coverage/frontend/lcov.info - - run: name: List coverage directory contents command: | @@ -361,14 +230,10 @@ workflows: version: 2 build: jobs: - - lint - - frontend-tests - backend-tests - coverage: requires: - - frontend-tests - backend-tests - build: requires: - - lint - coverage diff --git a/.github/workflows/frontend-fe.yml b/.github/workflows/frontend-tests.yml similarity index 80% rename from .github/workflows/frontend-fe.yml rename to .github/workflows/frontend-tests.yml index 45ff25203..ef6c9aaa5 100644 --- a/.github/workflows/frontend-fe.yml +++ b/.github/workflows/frontend-tests.yml @@ -1,4 +1,4 @@ -name: Frontend Lint & Test +name: Frontend Tests on: push: @@ -18,10 +18,6 @@ jobs: ref: ${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} - - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true - - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 @@ -32,9 +28,6 @@ jobs: - name: Install pnpm dependencies run: pnpm install --frozen-lockfile - - name: Run eslint - run: pnpm run eslint - - name: Run frontend tests with coverage run: | mkdir -p coverage diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..d7756092d --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,54 @@ +name: Lint + +on: + push: + branches: + - develop + pull_request: + branches: + - develop + +jobs: + lint: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + + - uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + + - uses: pnpm/action-setup@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 23 + cache: 'pnpm' + + - name: Install pnpm dependencies + run: pnpm install --frozen-lockfile + + - name: Run eslint + run: pnpm run eslint + + - name: Verify swagger API specification + run: | + bundle exec rake swagger:build + if [[ `git status swagger/swagger.json --porcelain` ]] + then + echo "ERROR: The swagger.json file is not in sync with the yaml specification. Run 'rake swagger:build' and commit 'swagger/swagger.json'." + exit 1 + fi + mkdir -p ~/tmp + curl -L https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.3.0/openapi-generator-cli-6.3.0.jar > ~/tmp/openapi-generator-cli-6.3.0.jar + java -jar ~/tmp/openapi-generator-cli-6.3.0.jar validate -i swagger/swagger.json + + - name: Bundle audit + run: bundle exec bundle audit update && bundle exec bundle audit check -v + + - name: Rubocop + run: bundle exec rubocop --parallel