forked from wtsi-npg/npg_tracking
-
Notifications
You must be signed in to change notification settings - Fork 1
95 lines (82 loc) · 2.94 KB
/
testing_and_building_repos.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
name: testing_and_building_repo
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
perl: ['5.26']
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
ports:
- 3306:3306
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_ROOT_PASSWORD: null
MYSQL_DATABASE: npgt
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=5
name: Perl ${{ matrix.perl }}
steps:
- uses: actions/checkout@v3
- name: Change dbhost to 127.0.0.1
run: |
sed -i s/localhost/127.0.0.1/ ${GITHUB_WORKSPACE}/data/config.ini
- name: set timezone
run: |
sudo timedatectl set-timezone Europe/London
# Caching cpanm external modules
- name: Cache cpanm external modules
id: cpanmCache
uses: actions/cache@v3
with:
path: ~/perl5ext
key: ${{ runner.os }}-build-cpanm-external
#install libgd-dev and uuid-dev
- name: install libgd-dev and uuid-dev
run: |
sudo apt-get update
# https://github.com/actions/runner-images/issues/2139
sudo apt-get remove -y nginx libgd3
sudo apt-get install -y libgd-dev uuid-dev libgd-text-perl
- name: install cpanm
run: |
wget -qO - https://cpanmin.us | /usr/bin/perl - --sudo App::cpanminus
- name: running install scripts
run: |
cpanm --local-lib=~/perl5ext local::lib && eval $(perl -I ~/perl5ext/lib/perl5/ -Mlocal::lib)
${GITHUB_WORKSPACE}/scripts/before_install.sh $WTSI_NPG_GITHUB_URL $WTSI_NPG_BUILD_BRANCH
env:
WTSI_NPG_GITHUB_URL: https://github.com/wtsi-npg
WTSI_NPG_BUILD_BRANCH: ${GITHUB_HEAD_REF}
- name: install cpanm dependencies
run: |
eval $(perl -I ~/perl5ext/lib/perl5/ -Mlocal::lib=~/perl5npg)
eval $(perl -I ~/perl5ext/lib/perl5/ -Mlocal::lib=~/perl5ext)
cpanm --installdeps --notest .
- name: run Build.PL and ./Build
run: |
eval $(perl -I ~/perl5ext/lib/perl5/ -Mlocal::lib=~/perl5ext)
eval $(perl -I ~/perl5ext/lib/perl5/ -Mlocal::lib=~/perl5npg)
export TEST_AUTHOR=1
perl Build.PL
./Build test --verbose
./Build install
- name: run ./Build
run: |
eval $(perl -I ~/perl5ext/lib/perl5/ -Mlocal::lib=~/perl5ext)
export TEST_AUTHOR=1
./Build dist
export DIST_FILE=$(ls npg-tracking-*.tar.gz)
export MD5_FILE=$DIST_FILE.md5
md5sum $DIST_FILE > $MD5_FILE
export SHA256_FILE=$DIST_FILE.sha256
shasum -a 256 $DIST_FILE > $SHA256_FILE
# Archive logs if failure
- name: Archive CPAN logs
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: cpan_log
path: /home/runner/.cpanm/work/*/build.log
retention-days: 5