Skip to content

Commit 5407d6f

Browse files
josephperrottclydin
authored andcommitted
ci: migrate lint validation to GHA
Migrate validation job from CircleCI to Github Actions as part of a larger lint job.
1 parent d4e541d commit 5407d6f

File tree

3 files changed

+53
-62
lines changed

3 files changed

+53
-62
lines changed

.circleci/dynamic_config.yml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -189,30 +189,6 @@ jobs:
189189
paths:
190190
- ~/.cache/yarn
191191

192-
validate:
193-
executor: action-executor
194-
steps:
195-
- custom_attach_workspace
196-
- run:
197-
name: Validate Commit Messages
198-
command: >
199-
if [[ -n "${CIRCLE_PR_NUMBER}" ]]; then
200-
yarn ng-dev commit-message validate-range <<pipeline.git.base_revision>> <<pipeline.git.revision>>
201-
else
202-
echo "This build is not over a PR, nothing to do."
203-
fi
204-
- run:
205-
name: Validate Code Formatting
206-
command: yarn -s ng-dev format changed <<pipeline.git.base_revision>> --check
207-
- run:
208-
name: Validate NgBot Configuration
209-
command: yarn ng-dev ngbot verify
210-
- run:
211-
name: Validate Circular Dependencies
212-
command: yarn ts-circular-deps:check
213-
- run: yarn -s admin validate
214-
- run: yarn -s check-tooling-setup
215-
216192
build:
217193
executor: bazel-executor
218194
steps:
@@ -388,9 +364,6 @@ workflows:
388364
jobs:
389365
# Linux jobs
390366
- setup
391-
- validate:
392-
requires:
393-
- setup
394367

395368
# These jobs only really depend on Setup, but the build job is very quick to run (~35s) and
396369
# will catch any build errors before proceeding to the more lengthy and resource intensive

.github/workflows/ci.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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@ef022a04090aca0945862f9f69f8ff3ea5865f26
27+
- name: Setup ESLint Caching
28+
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
29+
with:
30+
path: .eslintcache
31+
key: ${{ runner.os }}-${{ hashFiles('.eslintrc.json') }}
32+
- name: Install node modules
33+
run: yarn install --frozen-lockfile --ignore-scripts
34+
- name: Run ESLint
35+
run: yarn lint --cache-strategy content
36+
- name: Validate NgBot Configuration
37+
run: yarn ng-dev ngbot verify
38+
- name: Validate Circular Dependencies
39+
run: yarn ts-circular-deps:check
40+
- name: Run Validation
41+
run: yarn -s admin validate
42+
- name: Check tooling setup
43+
run: yarn -s check-tooling-setup
44+
- name: Check commit message
45+
# Commit message validation is only done on pull requests as its too late to validate once
46+
# it has been merged.
47+
if: github.event_name == 'pull_request'
48+
run: yarn ng-dev commit-message validate-range ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}
49+
- name: Check code format
50+
# Code formatting checks are 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 format changed --check ${{ github.event.pull_request.base.sha }}

.github/workflows/lint.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)