Skip to content

Commit e9e3372

Browse files
ci: migrate lint job from CircleCI to GHA (#27433)
* ci: migrate lint job from CircleCI to GHA Migrate lint to Github Actions * fixup! ci: migrate lint job from CircleCI to GHA
1 parent fd04721 commit e9e3372

File tree

3 files changed

+58
-50
lines changed

3 files changed

+58
-50
lines changed

.circleci/config.yml

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -288,52 +288,6 @@ jobs:
288288
- run: ./scripts/circleci/run-saucelabs-tests.sh
289289
- *slack_notify_on_failure
290290

291-
# ----------------------------------
292-
# Lint job.
293-
# ----------------------------------
294-
lint:
295-
<<: *job_defaults
296-
environment:
297-
CI_GIT_BASE_REVISION: << pipeline.git.base_revision >>
298-
CI_GIT_REVISION: << pipeline.git.revision >>
299-
steps:
300-
- checkout_and_rebase
301-
- *restore_cache
302-
- *setup_bazel_ci_config
303-
- *yarn_install
304-
- *setup_bazel_binary
305-
306-
- run:
307-
name: Checking package externals
308-
command: |
309-
bazel build //:package_externals
310-
yarn check-package-externals $(bazel info bazel-bin)/package_externals.json
311-
312-
- run:
313-
name: Checking entry-points configuration
314-
command: |
315-
bazel build //:entry_points_manifest
316-
yarn check-entry-point-setup $(bazel info bazel-bin)/entry_points_manifest.json
317-
318-
- run: yarn ng-dev format changed --check << pipeline.git.base_revision >>
319-
- run: yarn ownerslint
320-
- run: yarn detect-component-id-collisions
321-
- run: yarn stylelint
322-
- run: yarn tslint
323-
- run: yarn -s ts-circular-deps:check
324-
# Should be last so that it doesn't prevent the other lint checks from running.
325-
- run:
326-
name: Check Commit Message (PR Only)
327-
# Only run the commit message checks on pull requests since we can't do
328-
# much about any failures that have made it into the main branch.
329-
command: |
330-
if [ -n "$CIRCLE_PR_NUMBER" ]; then
331-
yarn ng-dev commit-message validate-range $CI_GIT_BASE_REVISION $CI_GIT_REVISION
332-
fi
333-
334-
- *slack_notify_on_failure
335-
- *save_cache
336-
337291
# -------------------------------------------------------------------------------------------
338292
# Job that builds all release packages. The built packages can be then used in the same
339293
# workflow to publish snapshot builds.
@@ -623,16 +577,13 @@ workflows:
623577
filters: *only_on_pull_requests_filter
624578
requires:
625579
- build_release_packages
626-
- lint:
627-
filters: *ignore_presubmit_branch_filter
628580
- publish_snapshots:
629581
filters: *publish_branches_filter
630582
requires:
631583
- build_release_packages
632584
- deploy_docs_site:
633585
filters: *publish_branches_filter
634586
requires:
635-
- lint
636587
- build_release_packages
637588
- tests_browsers
638589

.github/angular-robot.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ merge:
5454

5555
# list of PR statuses that need to be successful
5656
requiredStatuses:
57-
- 'ci/circleci: lint'
5857
- 'ci/circleci: bazel_build'
5958
- 'ci/circleci: tests_browsers'
6059
- 'ci/circleci: tests_browserstack'

.github/workflows/ci.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- '[0-9]+.[0-9]+.x'
8+
pull_request:
9+
types: [opened, synchronize, reopened]
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
permissions: {}
16+
17+
defaults:
18+
run:
19+
shell: bash
20+
21+
jobs:
22+
lint:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Initialize environment
26+
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@852c3d1898775ec9fbc87213e519f16e78805b57
27+
with:
28+
cache-node-modules: true
29+
- name: Install node modules
30+
run: yarn install --frozen-lockfile
31+
- name: Checking package externals
32+
run: |
33+
bazel build //:package_externals
34+
yarn check-package-externals $(bazel info bazel-bin)/package_externals.json
35+
- name: Checking entry-points configuration
36+
run: |
37+
bazel build //:entry_points_manifest
38+
yarn check-entry-point-setup $(bazel info bazel-bin)/entry_points_manifest.json
39+
- name: Check OWNERS file
40+
run: yarn ownerslint
41+
- name: Check for component id collisions
42+
run: yarn detect-component-id-collisions
43+
- name: Check style lint
44+
run: yarn stylelint
45+
- name: Check code lint
46+
run: yarn tslint
47+
- name: Check for circular dependencies
48+
run: yarn -s ts-circular-deps:check
49+
- name: Check commit message
50+
# Commit message validation is only done on pull requests as its too late to validate once
51+
# it has been merged.
52+
if: github.event_name == 'pull_request'
53+
run: yarn ng-dev commit-message validate-range ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}
54+
- name: Check code format
55+
# Code formatting checks are only done on pull requests as its too late to validate once
56+
# it has been merged.
57+
if: github.event_name == 'pull_request'
58+
run: yarn ng-dev format changed --check ${{ github.event.pull_request.base.sha }}

0 commit comments

Comments
 (0)