Skip to content

Commit

Permalink
ci: migrate lint job from CircleCI to GHA (#50891)
Browse files Browse the repository at this point in the history
Migrate the lint job to Github Actions

PR Close #50891
  • Loading branch information
josephperrott committed Jul 11, 2023
1 parent de01f75 commit a4b0d29
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 19 deletions.
18 changes: 0 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -249,21 +249,6 @@ jobs:
- ./ng
- ./bazel_repository_cache

lint:
executor: default-executor
steps:
- custom_attach_workspace
- init_environment

- run: yarn -s tslint
- run: yarn -s --cwd aio lint
- run: yarn -s ng-dev format changed $CI_GIT_BASE_REVISION --check
- run: yarn -s ts-circular-deps:check
- run: yarn -s ng-dev pullapprove verify
- run: yarn -s ng-dev ngbot verify
- run: yarn -s ng-dev commit-message validate-range $CI_GIT_BASE_REVISION $CI_GIT_REVISION
- run: yarn -s check-tooling-setup

test:
executor:
name: test-browser-executor
Expand Down Expand Up @@ -668,9 +653,6 @@ workflows:
filters:
branches:
ignore: g3
- lint:
requires:
- setup
- test:
requires:
- setup
Expand Down
2 changes: 1 addition & 1 deletion .github/angular-robot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ merge:
# list of PR statuses that need to be successful
requiredStatuses:
- 'ci/circleci: build'
- 'ci/circleci: lint'
- 'CI / lint (pull_request)'
- 'google-internal-tests'
- 'pullapprove'

Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: CI

on:
push:
branches:
- main
- '[0-9]+.[0-9]+.x'
pull_request:
types: [opened, synchronize, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions: {}

defaults:
run:
shell: bash

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@852c3d1898775ec9fbc87213e519f16e78805b57
with:
cache-node-modules: true
node-module-directories: |
./node_modules
./aio/node_modules
- name: Install node modules
run: yarn install --immutable
- name: Install node modules in aio
run: yarn install --immutable --cwd aio
- name: Check code lint
run: yarn -s tslint
- name: Check code lint in aio
run: yarn -s --cwd aio lint
- name: Check for circular dependencies
run: yarn -s ts-circular-deps:check
- name: Validate pull approve configuration
run: yarn -s ng-dev pullapprove verify
- name: Validate angular robot configuration
run: yarn -s ng-dev ngbot verify
- name: Confirm code builds with typescript as expected
run: yarn -s check-tooling-setup
- name: Check commit message
# Commit message validation is only done on pull requests as its too late to validate once
# it has been merged.
if: github.event_name == 'pull_request'
run: yarn ng-dev commit-message validate-range ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}
- name: Check code format
# Code formatting checks are only done on pull requests as its too late to validate once
# it has been merged.
if: github.event_name == 'pull_request'
run: yarn ng-dev format changed --check ${{ github.event.pull_request.base.sha }}

0 comments on commit a4b0d29

Please sign in to comment.