Skip to content

Commit cf6def9

Browse files
committed
use separate check for code formatting
1 parent caebd12 commit cf6def9

File tree

3 files changed

+49
-28
lines changed

3 files changed

+49
-28
lines changed

.github/workflows/test.yml

Lines changed: 33 additions & 16 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 }}:upstream
23+
- run: npm install
24+
- name: Install Carton
25+
uses: perl-actions/install-with-cpm@v1
26+
with:
27+
install: Carton
28+
- name: Install CPAN deps
29+
uses: perl-actions/install-with-cpm@v1
30+
with:
31+
cpanfile: 'cpanfile'
32+
args: >
33+
--resolver=snapshot
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 upstream
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
@@ -40,8 +73,6 @@ jobs:
4073
DEVEL_COVER_OPTIONS: '-ignore,^local/'
4174
steps:
4275
- uses: actions/checkout@v4
43-
with:
44-
fetch-depth: 0
4576
if: matrix.resolver == 'snapshot'
4677
- uses: actions/checkout@v4
4778
if: matrix.resolver != 'snapshot'
@@ -91,17 +122,3 @@ jobs:
91122
fail_ci_if_error: true
92123
file: ./cover_db/codecov.json
93124
token: ${{ secrets.CODECOV_TOKEN }}
94-
- name: Install precious
95-
run: ./bin/install-precious /usr/local/bin
96-
- name: Install perlimports
97-
run: cpm install -g App::perlimports
98-
if: matrix.resolver == 'snapshot'
99-
- name: Fetch master
100-
run: git fetch origin master:master
101-
if: github.ref != 'refs/heads/master' && matrix.resolver == 'snapshot'
102-
- name: Lint files in diff (branch)
103-
run: precious lint -d master
104-
if: github.ref != 'refs/heads/master' && matrix.resolver == 'snapshot'
105-
- name: Lint all files (master)
106-
run: precious lint --all
107-
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: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ requires 'Gazelle';
3434
requires 'Getopt::Long::Descriptive';
3535
requires 'HTML::Escape';
3636
requires 'HTML::Restrict', '2.2.2';
37-
requires 'HTML::Tree';
3837
requires 'HTTP::Message::PSGI';
3938
requires 'HTTP::Request';
4039
requires 'HTTP::Request::Common';
@@ -90,14 +89,18 @@ requires 'With::Roles', '0.001002';
9089
requires 'WWW::Form::UrlEncoded::XS';
9190
requires 'XML::FeedPP';
9291

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';
92+
on test => sub {
93+
requires 'App::Prove';
94+
requires 'HTML::Tree';
95+
requires 'Test::More', '0.96';
96+
requires 'Test::Warnings';
97+
requires 'Test::XPath', '0.15';
98+
requires 'aliased', '0.34';
99+
};
100+
101+
on develop => sub {
102+
requires 'App::perlimports';
103+
requires 'Perl::Critic', '1.136';
104+
requires 'Perl::Tidy' => '20230909';
105+
requires 'Test::Vars';
106+
};

0 commit comments

Comments
 (0)