-
Notifications
You must be signed in to change notification settings - Fork 39
101 lines (84 loc) · 3.41 KB
/
debian-tests.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
name: Debian Tests
on:
push:
pull_request:
branches: [ devel ]
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 2 * * 6'
jobs:
deb_build:
name: "deb_build"
runs-on: ubuntu-latest
steps:
- name: "checkout GIT"
uses: actions/checkout@v4
- name: "deb build and upload"
uses: ./.github/actions/deb_build_upload
deb_tests:
name: "deb_tests"
needs: deb_build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
websrv: ['apache2', 'nginx']
execscript: ['deb_tester.sh', 'django_tester.sh']
steps:
- name: "checkout GIT"
uses: actions/checkout@v4
- name: "Prepare Ubuntu environment"
if: matrix.execscript == 'deb_tester.sh'
uses: ./.github/actions/deb_prep
with:
DEB_BUILD: false
- name: "Prepare Ubuntu environment"
if: matrix.execscript == 'django_tester.sh'
uses: ./.github/actions/deb_prep
with:
DEB_BUILD: false
DJANGO_DB: psql
- name: "Retrieve Version from version.py"
run: |
echo TAG_NAME=$(cat acme_srv/version.py | grep -i __version__ | head -n 1 | sed 's/__version__ = //g' | sed s/\'//g) >> $GITHUB_ENV
- name: Download debian package
uses: actions/download-artifact@v4
with:
name: acme2certifier_${{ env.TAG_NAME }}-${{ github.run_id }}-1_all.deb
path: data/
- name: "Prepare acme_srv.cfg with openssl_ca_handler"
run: |
mkdir -p data/volume/acme_ca
sudo mkdir -p data/volume/acme_ca/certs
sudo cp test/ca/sub-ca-key.pem test/ca/sub-ca-crl.pem test/ca/sub-ca-cert.pem test/ca/root-ca-cert.pem data/volume/acme_ca/
sudo cp .github/openssl_ca_handler.py_acme_srv_choosen_handler.cfg data/volume/acme_srv.cfg
sudo sed -i "s/examples\/ca_handler/\/var\/www\/acme2certifier\/examples\/ca_handler/g" data/volume/acme_srv.cfg
sudo sed -i "s/volume/\/var\/www\/acme2certifier\/volume/g" data/volume/acme_srv.cfg
- name: "Execute install scipt"
run: |
docker exec acme-srv sh /tmp/acme2certifier/$EXECSCRIPT install $WEBSRV
env:
WEBSRV: ${{ matrix.websrv }}
EXECSCRIPT: ${{ matrix.execscript }}
- name: "Test enrollment"
uses: ./.github/actions/acme_clients
- name: "[ * ] collecting test logs"
if: ${{ failure() }}
run: |
mkdir -p ${{ github.workspace }}/artifact/upload
docker exec acme-srv tar cvfz /tmp/acme2certifier/a2c.tgz /var/www/acme2certifier
sudo cp -rp data/ ${{ github.workspace }}/artifact/data/
sudo rm ${{ github.workspace }}/artifact/data/*.deb
if [ ${{ matrix.websrv }} == "apache2" ]; then
docker exec acme-srv cat /var/log/apache2/error.log > ${{ github.workspace }}/artifact/acme-srv.log
else
docker exec acme-srv cat /var/log/nginx/error.log > ${{ github.workspace }}/artifact/acme-srv.log
fi
docker exec acme-srv cat /var/log/syslog > ${{ github.workspace }}/artifact/syslog
sudo tar -C ${{ github.workspace }}/artifact/ -cvzf ${{ github.workspace }}/artifact/upload/artifact.tar.gz data acme-srv.log syslog
- name: "[ * ] uploading artificates"
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: deb_test-${{ matrix.websrv }}-${{ matrix.execscript }}.tar.gz
path: ${{ github.workspace }}/artifact/upload/