Integration tests #766
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: Integration tests | |
on: | |
push: | |
branches: [ development, main ] | |
pull_request: | |
branches: [ development ] | |
schedule: | |
- cron: '0 0 * * 5' | |
jobs: | |
integration-tests: | |
runs-on: ubuntu-latest | |
name: "Run integration tests" | |
strategy: | |
matrix: | |
spamassassin: ["3.4.6", "4.0.1"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Poetry | |
run: pipx install poetry | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
cache: 'poetry' | |
- name: Install dependencies | |
run: poetry install | |
- name: Download SpamAssasin | |
run: | | |
curl -s https://dlcdn.apache.org//spamassassin/source/Mail-SpamAssassin-${{ matrix.spamassassin }}.tar.bz2 -o spamassassin.tar.bz2 | |
tar -xvjf spamassassin.tar.bz2 | |
- name: Build & Install SpamAssassin | |
working-directory: ./Mail-SpamAssassin-${{ matrix.spamassassin }} | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y perl libssl-dev libhtml-parser-perl libnet-dns-perl libnetaddr-ip-perl debhelper-compat libberkeleydb-perl netbase libdbi-perl libdbd-mysql-perl libbsd-resource-perl libio-string-perl libtext-diff-perl | |
sudo apt-get install -y adduser libarchive-tar-perl libhttp-date-perl libmail-dkim-perl libnet-dns-perl libnetaddr-ip-perl libsocket6-perl libio-socket-ssl-perl | |
perl Makefile.PL BUILD_SPAMC=no ENABLE_SSL=yes [email protected] | |
make | |
sudo make install | |
- run: sudo sa-update | |
- run: spamd --version | |
- name: Run integration tests | |
run: > | |
poetry run pytest -m integration | |
--cov | |
--cov-report="xml:output/coverage.xml" | |
--cov-fail-under=0 | |
--junit-xml="output/integration-tests.xml" | |
- name: Publish test results | |
if: success() || failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-results-${{ matrix.spamassassin }} | |
path: output/** | |
- name: Upload to Codecov.io | |
if: success() || failure() | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: output/coverage.xml | |
flags: integrationtests | |
status: | |
if: ${{ always() }} | |
runs-on: ubuntu-latest | |
name: "Integration Test Status" | |
needs: integration-tests | |
steps: | |
- name: Check test matrix status | |
if: ${{ needs.integration-tests.result != 'success' }} | |
run: exit 1 |