-
Notifications
You must be signed in to change notification settings - Fork 0
159 lines (148 loc) · 6.49 KB
/
ci.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
149
150
151
152
153
154
155
156
157
158
159
name: Run Tests
on:
push:
branches:
- '*'
pull_request:
env:
# Note Python3 is already installed in virtual-environments.
PKG_NAME: Meson
PKG_UBUNTU: meson
PKG_HOMEBREW: meson
PKG_MSYS2_MINGW64: mingw-w64-x86_64-meson
PKG_MSYS2_MINGW64_DEPS: >-
base-devel
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-perl
mingw-w64-x86_64-curl
mingw-w64-x86_64-python
jobs:
dist:
name: Make distribution using Dist::Zilla
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Cache ~/perl5
uses: actions/cache@v3
with:
key: ${{ runner.os }}-dist-locallib
path: ~/perl5
- name: Perl version
run: |
perl -v
- name: Install cpanm
run: |
curl -L https://cpanmin.us | perl - --sudo App::cpanminus
- name: Install local::lib
run: |
cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
- name: Install Dist::Zilla
shell: bash
run: |
eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
cpanm -n Dist::Zilla
dzil authordeps --missing | cpanm -n
- name: Make distribution
shell: bash
run: |
eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
dzil build --in build-dir
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: dist
path: ./build-dir
test:
needs: dist
runs-on: ${{ matrix.os }}
defaults:
run:
# bash on macos and linux
# powershell on windows + strawberry perl
# msys2 {0} on windows + msys2
shell: >-
${{ fromJSON( '["", "bash {0}"]' )[ startsWith(matrix.os, 'ubuntu-' ) || startsWith(matrix.os, 'macos-') ]
}}${{ fromJSON( '["", "powershell {0}"]' )[ startsWith(matrix.os, 'windows-') && matrix.dist == 'strawberry' ]
}}${{ fromJSON( '["", "msys2 {0}"]' )[ startsWith(matrix.os, 'windows-') && matrix.dist == 'msys2' ] }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
perl-version: ['5.8', '5.20', '5.30', '5.34']
alien-install-type: [ 'system', 'share' ]
alien-meson-share-prefer: [ 'auto' ] # auto is the default for $ALIEN_MESON_SHARE_PREFER
include:
# Windows strawberry | (share, toggle share-prefer)
- { perl-version: '5.34' , os: windows-latest , dist: strawberry , alien-install-type: 'share' , alien-meson-share-prefer: 'auto' }
- { perl-version: '5.34' , os: windows-latest , dist: strawberry , alien-install-type: 'share' , alien-meson-share-prefer: 'binary' }
- { perl-version: '5.34' , os: windows-latest , dist: strawberry , alien-install-type: 'share' , alien-meson-share-prefer: 'source' }
# Windows msys2 | system, (share, toggle share-prefer)
- { perl-version: '5.34' , os: windows-latest , dist: msys2 , alien-install-type: 'system' }
- { perl-version: '5.34' , os: windows-latest , dist: msys2 , alien-install-type: 'share' , alien-meson-share-prefer: 'auto' }
- { perl-version: '5.34' , os: windows-latest , dist: msys2 , alien-install-type: 'share' , alien-meson-share-prefer: 'binary' }
- { perl-version: '5.34' , os: windows-latest , dist: msys2 , alien-install-type: 'share' , alien-meson-share-prefer: 'source' }
# macOS | system, share
- { perl-version: '5.34' , os: macos-11 , alien-install-type: 'system' }
- { perl-version: '5.34' , os: macos-11 , alien-install-type: 'share' , alien-meson-share-prefer: 'auto' }
- { perl-version: '5.34' , os: macos-11 , alien-install-type: 'share' , alien-meson-share-prefer: 'binary' }
- { perl-version: '5.34' , os: macos-11 , alien-install-type: 'share' , alien-meson-share-prefer: 'source' }
name: Perl ${{ matrix.perl-version }} on ${{ matrix.os }} with install-type ${{ matrix.alien-install-type }}, dist ${{ matrix.dist }}, share-prefer ${{ matrix.alien-meson-share-prefer || 'auto' }}
steps:
- name: Get dist artifact
uses: actions/download-artifact@v3
with:
name: dist
# Setup system package
- name: Setup system ${{ env.PKG_NAME }} (apt)
if: runner.os == 'Linux' && matrix.alien-install-type == 'system'
run: |
sudo apt-get -y update && sudo apt-get install -y ${{ env.PKG_UBUNTU }}
- name: Setup system ${{ env.PKG_NAME }} (homebrew)
if: runner.os == 'macOS' && matrix.alien-install-type == 'system'
run: |
brew install ${{ env.PKG_HOMEBREW }}
- name: Set up MSYS2
uses: msys2/setup-msys2@v2
if: runner.os == 'Windows' && matrix.dist == 'msys2'
with:
update: true
install: ${{ env.PKG_MSYS2_MINGW64_DEPS }}
- name: Set up ${{ env.PKG_NAME }} (MSYS2/MinGW pacman)
if: runner.os == 'Windows' && matrix.dist == 'msys2' && matrix.alien-install-type == 'system'
shell: msys2 {0}
run: |
pacman -S --needed --noconfirm ${{ env.PKG_MSYS2_MINGW64 }}
# Setup Perl
- name: Set up perl
uses: shogo82148/actions-setup-perl@v1
if: runner.os != 'Windows'
with:
perl-version: ${{ matrix.perl-version }}
- name: Set up perl (Strawberry)
uses: shogo82148/actions-setup-perl@v1
if: runner.os == 'Windows' && matrix.dist == 'strawberry'
with:
distribution: 'strawberry'
- run: perl -V
- name: Install cpanm
if: runner.os == 'Windows' && matrix.dist == 'msys2'
run:
yes | cpan -T App::cpanminus || true
- name: Install Perl deps
run: |
cpanm --notest --installdeps .
- name: Set ALIEN_INSTALL_TYPE
shell: bash
run: |
echo "ALIEN_INSTALL_TYPE=${{ matrix.alien-install-type }}" >> $GITHUB_ENV
- name: Set ALIEN_MESON_SHARE_PREFER
if: matrix.alien-meson-share-prefer
shell: bash
run: |
echo "ALIEN_MESON_SHARE_PREFER=${{ matrix.alien-meson-share-prefer }}" >> $GITHUB_ENV
- name: Run tests
env:
ALIEN_BUILD_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cpanm --verbose --test-only .