Skip to content

Commit 2a6f7dc

Browse files
committed
Add linting as a build step in CI
1 parent 40da22c commit 2a6f7dc

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

.github/workflows/test.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ jobs:
3838
DEVEL_COVER_OPTIONS: '-ignore,^local/'
3939
steps:
4040
- uses: actions/checkout@v4
41+
with:
42+
fetch-depth: 0
43+
if: matrix.resolver == 'snapshot'
44+
- uses: actions/checkout@v4
45+
if: matrix.resolver != 'snapshot'
4146
- uses: actions/setup-node@v4
4247
with:
4348
node-version: '18'
@@ -83,3 +88,17 @@ jobs:
8388
run: cover -report codecov
8489
env:
8590
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
91+
- name: Install precious
92+
run: ./bin/install-precious /usr/local/bin
93+
- name: Install perlimports
94+
run: cpm install -g App::perlimports
95+
if: matrix.resolver == 'snapshot'
96+
- name: Fetch master
97+
run: git fetch origin master:master
98+
if: github.ref != 'refs/heads/master' && matrix.resolver == 'snapshot'
99+
- name: Lint files in diff (branch)
100+
run: precious lint -d master
101+
if: github.ref != 'refs/heads/master' && matrix.resolver == 'snapshot'
102+
- name: Lint all files (master)
103+
run: precious lint --all
104+
if: github.ref == 'refs/heads/master' && matrix.resolver == 'snapshot'

bin/install-precious

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env bash
22

3-
# This is for installing precious in a Docker container
3+
# This is for installing precious and other 3rd party libs needed for linting
4+
# in CI
45

56
set -euo pipefail
67

0 commit comments

Comments
 (0)