Debian Tests #109
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ | |