forked from irssi/scripts.irssi.org
-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (126 loc) · 4.84 KB
/
test.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
on:
push:
branches:
- master
pull_request:
name: Check Script
env:
apt_build_deps: irssi-git-an irssi-python3 cpanminus elinks flake8 zsh
apt_script_deps: libdb-dev libaspell-dev libgirepository1.0-dev gobject-introspection gir1.2-notify-0.7 xosd-bin wbritish
USE_ARTEFACTS_CACHE: yes
EXTRACT_TEST_ARTEFACTS: yes
PERL_MM_NONINTERACTIVE: 1
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
with:
fetch-depth: 0
- name: prepare required software
run: |
RELEASE=$(lsb_release -rs)
echo "deb http://download.opensuse.org/repositories/home:/ailin_nemui:/irssi-git-an/xUbuntu_$RELEASE/ /" | sudo tee /etc/apt/sources.list.d/home:ailin_nemui:irssi-git.list
curl -fsSL https://download.opensuse.org/repositories/home:ailin_nemui:irssi-git-an/xUbuntu_$RELEASE/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/home_ailin_nemui_irssi-git-an.gpg > /dev/null
sudo apt -q update
sudo apt -q install $apt_build_deps $apt_script_deps
- name: Setup flake8 annotations
uses: rbialon/flake8-annotations@master
if: ${{ github.event_name == 'pull_request' }}
- name: Setup local annotations
if: ${{ github.event_name == 'pull_request' }}
run: |
for pm in "$PWD"/.github/pm-*.json; do
echo "::add-matcher::$pm"
done
- name: check versions
id: ver
run: |
echo "perl_version=$(perl -e'print $^V')" | tee -a "$GITHUB_OUTPUT"
echo "python_version=$(python3 -c 'import platform; print(platform.python_version())')" | tee -a "$GITHUB_OUTPUT"
echo "irssi_version=$(irssi --version | awk '{print $2}')" | tee -a "$GITHUB_OUTPUT"
- name: cache cpan
uses: actions/cache@main
with:
path: |
~/extlib
key: ${{ runner.os }}-${{ steps.ver.outputs.perl_version }}-cpan-${{ github.sha }}-${{ github.run_number }}
restore-keys: |
${{ runner.os }}-${{ steps.ver.outputs.perl_version }}-cpan-${{ github.sha }}-
${{ runner.os }}-${{ steps.ver.outputs.perl_version }}-cpan-
- name: fetch origin master branch
if: ${{ github.event_name == 'pull_request' }}
run: |
git fetch origin refs/heads/master
- name: configure local::lib
run: |
eval $(perl -Mlocal::lib="$HOME"/extlib)
for v in PATH PERL5LIB PERL_LOCAL_LIB_ROOT PERL_MB_OPT PERL_MM_OPT; do
eval echo "\$v=\$$v" >> "$GITHUB_ENV"
done
- name: fix the broken Encode module
run: |
cpanm Encode
- uses: actions/checkout@main
if: ${{ env.USE_ARTEFACTS_CACHE == 'yes' }}
with:
ref: ci-artefacts
path: old-artefacts
- name: load old artefacts
if: ${{ env.USE_ARTEFACTS_CACHE == 'yes' }}
run:
./_testing/github/load-old-artefacts.zsh
- name: install cpan dependencies
run: |
cpanm --installdeps --notest .
./_testing/autoinstall-perl-prereqs.zsh
- name: auto-install cpan script dependencies
run: |
pushd auto
cpanm --quiet --installdeps --notest .
popd
- name: auto-install python script dependencies
run: |
pip install pipreqs
./_testing/autoinstall-python-prereqs.zsh
pip install -r pipreqs_scan/requirements.txt
- name: run tests
run: |
./_testing/run-test.zsh
- name: show diffstat
if: ${{ github.event_name == 'pull_request' }}
run: |
git diff --stat origin/master
MARKDOWN_REPORT=1 ./_testing/report-test.zsh >> "$GITHUB_STEP_SUMMARY" || :
- name: test report
run: |
./_testing/report-test.zsh || rc=$?
echo "SCRIPT_RC=${rc:-0}" >> "$GITHUB_ENV"
- name: integration report
run: |
./_testing/github/show-failures.zsh
- name: update scripts.yaml
run: |
perl ./_testing/update-scripts-yaml.pl
- name: show git changes
if: ${{ github.event_name == 'pull_request' }}
run: |
echo '```' >> "$GITHUB_STEP_SUMMARY"
git diff | tee -a "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
- name: commit scripts.yaml
if: ${{ github.event_name == 'push' }}
run: |
./_testing/github/commit-scripts-yaml.zsh
- uses: actions/checkout@main
if: ${{ github.event_name == 'push' && env.EXTRACT_TEST_ARTEFACTS == 'yes' }}
with:
ref: ci-artefacts
path: artefacts
- name: extract artefacts
if: ${{ github.event_name == 'push' && env.EXTRACT_TEST_ARTEFACTS == 'yes' }}
run: |
./_testing/github/extract-artefacts.zsh
- name: end
run: |
exit $SCRIPT_RC