Skip to content

Commit 4107c62

Browse files
committed
use separate check for code formatting
1 parent 992d6bd commit 4107c62

File tree

3 files changed

+48
-25
lines changed

3 files changed

+48
-25
lines changed

.github/workflows/test.yml

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,39 @@ on:
1010
workflow_dispatch:
1111

1212
jobs:
13+
code-formatting:
14+
runs-on: ubuntu-22.04
15+
name: Code Formatting
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
- name: Fetch base ref
21+
if: ${{ github.event.pull_request }}
22+
run: git fetch origin ${{ github.base_ref }}
23+
- run: npm install
24+
- name: Install CPAN deps
25+
uses: perl-actions/install-with-cpm@v1
26+
with:
27+
cpanfile: 'cpanfile'
28+
sudo: false
29+
args: >
30+
-
31+
--resolver=snapshot
32+
--show-build-log-on-failure
33+
--local-lib-contained=local
34+
--without-runtime
35+
--without-test
36+
--without-build
37+
--with-develop
38+
- name: Install precious
39+
run: ./bin/install-precious /usr/local/bin
40+
- name: Lint modified files
41+
if: ${{ github.event.pull_request }}
42+
run: precious lint --git-diff-from ${{ github.base_ref }}
43+
- name: Lint all files
44+
if: ${{ ! github.event.pull_request }}
45+
run: precious lint --all
1346
docker:
1447
runs-on: ubuntu-22.04
1548
name: Docker
@@ -93,17 +126,3 @@ jobs:
93126
fail_ci_if_error: true
94127
file: ./cover_db/codecov.json
95128
token: ${{ secrets.CODECOV_TOKEN }}
96-
- name: Install precious
97-
run: ./bin/install-precious /usr/local/bin
98-
- name: Install perlimports
99-
run: cpm install -g App::perlimports
100-
if: matrix.resolver == 'snapshot'
101-
- name: Fetch master
102-
run: git fetch origin master:master
103-
if: github.ref != 'refs/heads/master' && matrix.resolver == 'snapshot'
104-
- name: Lint files in diff (branch)
105-
run: precious lint -d master
106-
if: github.ref != 'refs/heads/master' && matrix.resolver == 'snapshot'
107-
- name: Lint all files (master)
108-
run: precious lint --all
109-
if: github.ref == 'refs/heads/master' && matrix.resolver == 'snapshot'

.github/workflows/update-snapshot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ jobs:
6464
--resolver metacpan
6565
--show-build-log-on-failure
6666
--local-lib-contained=local
67+
--with-develop
6768
- name: Maybe update cpanfile.snapshot
6869
run: carton
6970
- name: Create Pull Request

cpanfile

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,17 @@ requires 'With::Roles', '0.001002';
9090
requires 'WWW::Form::UrlEncoded::XS';
9191
requires 'XML::FeedPP';
9292

93-
# Test dependencies
94-
requires 'aliased', '0.34';
95-
requires 'App::Prove';
96-
requires 'Perl::Critic', '1.136';
97-
requires 'Perl::Tidy' => '20230909';
98-
requires 'Test::Code::TidyAll';
99-
requires 'Test::More', '0.96';
100-
requires 'Test::Needs';
101-
requires 'Test::Perl::Critic';
102-
requires 'Test::Warnings';
103-
requires 'Test::XPath', '0.15';
93+
on test => sub {
94+
requires 'aliased', '0.34';
95+
requires 'App::Prove';
96+
requires 'Test::More', '0.96';
97+
requires 'Test::Warnings';
98+
requires 'Test::XPath', '0.15';
99+
};
100+
101+
on develop => sub {
102+
requires 'Perl::Critic', '1.136';
103+
requires 'Perl::Tidy' => '20230909';
104+
requires 'Test::Vars';
105+
requires 'App::perlimports';
106+
};

0 commit comments

Comments
 (0)