Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Lint job from CircleCI to Github Action #4071

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,22 +151,6 @@ step_bundle_install: &step_bundle_install
else
echo "All required gems were found in cache."
fi
step_rubocop: &step_rubocop
run:
name: Delint with Rubocop
# 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 rake rubocop
step_standardrb: &step_standardrb
run:
name: Delint 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 rake standard
step_appraisal_install: &step_appraisal_install
run:
name: Install Appraisal gems
Expand Down Expand Up @@ -375,17 +359,6 @@ orbs:
root: .
paths:
- coverage
lint:
<<: *test_job_default
steps:
- restore_cache:
keys:
- '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundled-repo-<<parameters.ruby_version>>-{{ .Environment.CIRCLE_SHA1 }}'
- restore_cache:
keys:
- bundle-{{ .Environment.CIRCLE_CACHE_VERSION }}-{{ checksum ".circleci/images/primary/binary_version" }}-<<parameters.ruby_version>>-{{ checksum "lib/datadog/version.rb" }}-{{ .Branch }}-{{ checksum ".circleci/bundle_checksum" }}
- *step_rubocop
- *step_standardrb
coverage:
<<: *test_job_default
steps:
Expand Down Expand Up @@ -513,11 +486,6 @@ workflows:
version: 2
build-and-test:
jobs:
- orb/lint:
<<: *config-2_7-small
name: lint
requires:
- build-2.7
- orb/coverage:
<<: *config-2_7-small
name: coverage
Expand Down
25 changes: 16 additions & 9 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
name: Check
on:
push:
branches: [ '**' ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ '**' ]

jobs:
lint:
runs-on: ubuntu-latest
container:
image: ghcr.io/datadog/images-rb/engines/ruby:3.2
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: bundle install
- run: bundle exec rake rubocop standard
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be clearer (for the person reading failures) to have rubocop and standard invoked separately.


check:
name: Check types
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
container:
image: ghcr.io/datadog/images-rb/engines/ruby:3.2
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Install dependencies
run: bundle install
- name: Check for stale signature files
run: bundle exec rake rbs:stale
- name: Check for missing signature files
Expand Down
Loading