-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (144 loc) · 6.01 KB
/
windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# brian's standard GitHub Actions Windows config for Perl 5 modules
# version 20250126.001
# https://github.com/briandfoy/github_workflows
# https://github.com/features/actions
# This file is licensed under the Artistic License 2.0
#
# This uses the AUTOMATED_TESTING environment that you can set up
# in your repo settings. Or not. It still works if it isn't defined.
# In that environment, add whatever environment variables or secrets
# that you want.
#
# EXTRA_CPAN_MODULES - extra arguments to the first call to cpan.
# Just use EXTRA_CPANM_MODULES though. This is
# here for legacy
#
# EXTRA_CPANM_MODULES - extra arguments to the first call to cpanm.
# this is useful to install very particular
# modules, such as DBD::mysql@4.050
#
# WINDOWS_EXTRA_CPANM_MODULES - extra arguments to the first call to cpanm
# but only on Windows. Other workflows won't use this.
# this is useful to install very particular
# modules, such as DBD::mysql@4.050
---
name: windows
# https://github.com/actions/checkout/issues/1590
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/using-concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
cancel-in-progress: true
on:
push:
branches:
- '**'
- '!**appveyor**'
- '!**circleci**'
- '!**linux**'
- '!**macos**'
- '!**notest**'
- '!**release**'
tags-ignore:
# I tag release pushes but those should have already been tested
- 'release-*'
paths-ignore:
# list all the files which are irrelevant to the tests
# non-code, support files, docs, etc
- '.appveyor.yml'
- '.circleci'
- '.gitattributes'
- '.github/workflows/linux.yml'
- '.github/workflows/macos.yml'
- '.github/workflows/release.yml'
- '.gitignore'
- '.releaserc'
- 'Changes'
- 'LICENSE'
- 'README.pod'
- 'README.md'
- 'SECURITY.md'
pull_request:
jobs:
perl:
environment: automated_testing
runs-on: ${{ matrix.os }}
# store any secrets in an environment named "testing"
strategy:
matrix:
os:
- windows-2019
- windows-2022
steps:
- run: git config --global core.autocrlf false
- uses: actions/checkout@v3
- name: Set up Perl
run: |
choco uninstall strawberryperl
choco upgrade strawberryperl
echo "C:\strawberry\c\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\strawberry\perl\site\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\strawberry\perl\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Perl version
run: perl -V
# cpan can operate with https, but we need IO::SSL::Socket, which
# does not come with Perl.
#
# When using cpan, use -M to specify the CDN-backed www.cpan.org
# mirror. I've noticed that letting CPAN.pm auto-choose mirrors
# sometimes selects things that the action can't reach.
#
# Also, use the -T option to not test the dependencies. Assume these
# mainline modules are good and save lots of CI minutes.
- name: Install cpanm and multiple modules
run: |
cpan -M http://www.cpan.org -T App::cpanminus ${{ vars.EXTRA_CPAN_MODULES }}
cpanm --notest IO::Socket::SSL LWP::Protocol::https HTTP::Tiny ExtUtils::MakeMaker Test::Manifest Test::More ${{ vars.EXTRA_CPANM_MODULES }} ${{ vars.WINDOWS_EXTRA_CPANM_MODULES }}
# Install the dependencies, again not testing them. This installs the
# module in the current directory, so we end up installing the module,
# but that's not a big deal.
- name: Install dependencies
run: |
cpan -M https://www.cpan.org -T .
- name: Run tests
run: |
perl Makefile.PL
make test
# Run author tests, but only if there's an xt/ directory
- name: Author tests
if: hashFiles('xt') != ''
run: |
cpan -M https://www.cpan.org -T Test::CPAN::Changes
prove -r -b xt
# Running tests in parallel should be faster, but it's also more
# tricky in cases where different tests share a feature, such as a
# file they want to write to. Parallel tests can stomp on each other.
# Test in parallel to catch that, because other people will test your
# stuff in parallel.
- name: Run tests in parallel
env:
HARNESS_OPTIONS: j10
run: |
perl Makefile.PL
make test
# The disttest target creates the distribution, unwraps it, changes
# into the dist dir, then runs the tests there. That checks that
# everything that should be in the dist is in the dist. If you forget
# to update MANIFEST with new modules, data files, and so on, you
# should notice the error.
- name: Run distribution tests
run: |
perl Makefile.PL
make disttest
make clean
# And, coverage reports. Windows Devel::Coverage can't handle threads,
# so set the env var WINDOWS_SKIP_COVERAGE to skip this part.
- name: Run coverage tests
if: env.WINDOWS_SKIP_COVERAGE != 0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cpan -M https://www.cpan.org -T Devel::Cover Devel::Cover::Report::Coveralls
perl Makefile.PL
cover -test -report coveralls