From 0bc3fee9fd87d354a9be9823e192526d23a6d9a7 Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 27 Nov 2024 13:52:58 +0100 Subject: [PATCH] migrate lint task from circleci to GHA --- .circleci/config.yml | 23 ----------------------- .github/workflows/check.yml | 16 ++++++++++++++-- 2 files changed, 14 insertions(+), 25 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b8904283..13a340d4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -71,14 +71,6 @@ step_bundle_install: &step_bundle_install else echo "All required gems were found in cache." fi -step_lint: &step_lint - run: - name: Lint with standardrb - # There's no straightforward way to get the number of available processors & CPU threads in CircleCI. - # Currently it always return 18 physical processors and 36 threads, regardless of executor size. - # The workaround is to use `cpu.shares / 1024`: - # https://discuss.circleci.com/t/environment-variable-set-to-the-number-of-available-cpus/32670/4 - command: PARALLEL_PROCESSOR_COUNT=$((`cat /sys/fs/cgroup/cpu/cpu.shares` / 1024)) bundle exec standardrb step_appraisal_install: &step_appraisal_install run: name: Install Appraisal gems @@ -173,16 +165,6 @@ orbs: - *step_run_all_tests - store_test_results: path: /tmp/rspec - lint: - <<: *test_job_default - steps: - - restore_cache: - keys: - - '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundled-repo-<>-{{ .Environment.CIRCLE_SHA1 }}' - - restore_cache: - keys: - - bundle-{{ .Environment.CIRCLE_CACHE_VERSION }}-{{ checksum ".circleci/images/primary/binary_version" }}-<>-{{ checksum "lib/datadog/ci/version.rb" }}-{{ .Branch }}-{{ checksum ".circleci/bundle_checksum" }} - - *step_lint commands: docker-wait: description: Wait for containers to listen on a TCP port. @@ -249,11 +231,6 @@ workflows: version: 2 build-and-test: jobs: - - orb/lint: - <<: *config-3_3-small - name: lint - requires: - - build-3.2 - orb/build: <<: *config-2_7 name: build-2.7 diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index b2949916..e35279c3 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -6,8 +6,20 @@ on: # The branches below must be a subset of the branches above branches: [main] jobs: - check: - name: Check types + lint: + name: Lint + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3' + - name: Install dependencies + run: bundle install + - run: bundle exec rake standard + + typecheck: + name: Type checking runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4