Run tests against latest openSUSE Leap 15.5 #159
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: Run tests against latest openSUSE Leap 15.4 | |
on: | |
push: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 13 * * 0' | |
jobs: | |
run-tests: | |
runs-on: macos-12 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Download current box metadata needed for GitHub cache key | |
run: | | |
BOX_URL=$(cat tests/Vagrantfile | sed -n -E 's/.*config\.vm\.box_url = "([^"]*).*/\1/p') | |
wget -O tests/opensuse.json "${BOX_URL}" | |
- name: Cache Vagrant boxes | |
uses: actions/cache@v3 | |
with: | |
path: ~/.vagrant.d/boxes | |
key: ${{ runner.os }}-vagrant-${{ hashFiles('tests/opensuse.json') }} | |
- name: Show Vagrant version | |
run: vagrant --version | |
- name: Use Python 3.x | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install pipenv | |
run: pip install pipenv | |
- name: Cache pipenv environment | |
id: cache-pipenv | |
uses: actions/cache@v3 | |
with: | |
path: ~/.local/share/virtualenvs | |
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }} | |
- name: Install required (and locked) dependecies with pipenv | |
if: steps.cache-pipenv.outputs.cache-hit != 'true' | |
run: pipenv install --dev | |
# Setting env variables as "pipenv run make -j2 setup" doesn't terminate | |
- name: Enable pipenv environment | |
run: | | |
echo "VIRTUAL_ENV=$(pipenv --venv)" >> $GITHUB_ENV | |
echo "$(pipenv --venv)/bin" >> $GITHUB_PATH | |
- name: Print environment variables | |
run: export | |
- name: Ensure to use the latest boxes | |
run: vagrant box update | |
working-directory: tests | |
- name: Prepare Vagrant test environment | |
run: make -j setup | |
working-directory: tests | |
- name: Run tests | |
run: make -k tests | |
working-directory: tests | |
- name: Gather facts | |
run: | | |
pip list | |
vagrant ssh -c "ip addr show" ns | |
vagrant ssh -c "ip addr show" sut | |
vagrant ssh -c "ip addr show" client | |
vagrant ssh -c "ip addr show" mail-sink | |
vagrant ssh -c "dig mydomain.test MX" client | |
vagrant ssh -c "ping -c 3 192.168.56.10" client | |
vagrant ssh -c "sudo journalctl --no-pager -n 50 -u named" ns | |
vagrant ssh -c "systemctl --no-page list-units --type=service" sut | |
vagrant ssh -c "sudo journalctl --no-pager -n 50 -u clamd" sut | |
vagrant ssh -c "sudo journalctl --no-pager -n 50 -u postfix" sut | |
vagrant ssh -c "sudo journalctl --no-pager -n 50 -u rspamd" sut | |
vagrant ssh -c "sudo journalctl --no-pager -n 50 -u dovecot" sut | |
working-directory: tests |