Skip to content

Commit

Permalink
Migrate Lint job from CircleCI to Github Action
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyCTHsu committed Nov 5, 2024
1 parent 243ed25 commit d2b474f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 41 deletions.
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

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

0 comments on commit d2b474f

Please sign in to comment.