Skip to content

Commit 4242121

Browse files
committed
Move CI lint/format checks into separate file
This is the first PR in what will be several PRs to update and improve the CI checks workflows. This PR simply moves the lint & format checks to a new, separate workflow file (`ci-file-checks.yaml`) and renames `ci.yaml` to `ci-build-checks.yaml`. There are no functional changes, apart from adjusting the conditions of the build tests in `ci-build-checks.yaml` not condition them on passing lint/format checks. Lint/format checks are not a strictly necessary precondition to testing builds and doing unit tests, and running them in parallel affords a couple of advantages: - Faster overall CI execution. - Potential for more feedback. If a lint step fails, it doesn't necessarily mean that code won't compile, and proceeding with the build tests gives devs as much feedback as possible. There is of course the danger that the code changes won't compile, and the resulting build will be pointless (and possibly produce confusing error messages). I think devs will be smart enough to realize that if they see _both_ lint/format errors and build errors, they should fix the former first. In addition, we can tune the conditions in the builds so that they fail early.
1 parent 452a212 commit 4242121

File tree

2 files changed

+35
-33
lines changed

2 files changed

+35
-33
lines changed

.github/workflows/ci.yaml renamed to .github/workflows/ci-build-checks.yaml

+1-33
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,7 @@ name: Continuous Integration
22

33
on: [pull_request]
44

5-
65
jobs:
7-
lint:
8-
name: Lint check
9-
runs-on: ubuntu-20.04
10-
steps:
11-
- uses: actions/checkout@v1
12-
- uses: actions/setup-python@v1
13-
with:
14-
python-version: '3.10'
15-
architecture: 'x64'
16-
- name: Install Lint tools
17-
run: pip install --upgrade pip setuptools; pip install -r requirements.txt;
18-
- name: Lint All
19-
run: ./scripts/lint_all.sh
20-
21-
format:
22-
name: Formatting check
23-
runs-on: ubuntu-20.04
24-
25-
steps:
26-
- uses: actions/checkout@v1
27-
- uses: actions/setup-python@v1
28-
with:
29-
python-version: '3.10'
30-
architecture: 'x64'
31-
- name: Install Format tools
32-
run: pip install --upgrade pip setuptools; pip install -r requirements.txt; sudo apt-get install -y clang-format-6.0
33-
- name: Format Check
34-
run: ./scripts/format_check.sh
35-
366
wheel-build:
377
name: Wheel test
388
runs-on: ubuntu-20.04
@@ -55,7 +25,6 @@ jobs:
5525
bazel-tests:
5626
name: Library tests
5727
runs-on: ubuntu-20.04
58-
needs: [lint, format]
5928

6029
steps:
6130
- uses: actions/checkout@v1
@@ -78,7 +47,6 @@ jobs:
7847
# leak-tests:
7948
# name: Memory Leak tests
8049
# runs-on: ubuntu-20.04
81-
# needs: [lint, format]
8250
#
8351
# steps:
8452
# - uses: actions/checkout@v1
@@ -96,7 +64,7 @@ jobs:
9664
tutorials-test:
9765
name: Tutorial tests
9866
runs-on: ubuntu-20.04
99-
needs: [lint, format, wheel-build]
67+
needs: wheel-build
10068

10169
steps:
10270
- uses: actions/checkout@v1

.github/workflows/ci-file-checks.yaml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: CI file checks
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
lint:
7+
name: Lint check
8+
runs-on: ubuntu-20.04
9+
steps:
10+
- uses: actions/checkout@v1
11+
- uses: actions/setup-python@v1
12+
with:
13+
python-version: '3.10'
14+
architecture: 'x64'
15+
- name: Install Lint tools
16+
run: pip install --upgrade pip setuptools; pip install -r requirements.txt;
17+
- name: Lint All
18+
run: ./scripts/lint_all.sh
19+
20+
format:
21+
name: Formatting check
22+
runs-on: ubuntu-20.04
23+
24+
steps:
25+
- uses: actions/checkout@v1
26+
- uses: actions/setup-python@v1
27+
with:
28+
python-version: '3.10'
29+
architecture: 'x64'
30+
- name: Install Format tools
31+
run: pip install --upgrade pip setuptools; pip install -r requirements.txt; sudo apt-get install -y clang-format-6.0
32+
- name: Format Check
33+
run: ./scripts/format_check.sh
34+

0 commit comments

Comments
 (0)