fail on 404 if date > 2026-06-11
#338
Workflow file for this run
This file contains hidden or 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 | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| jobs: | |
| test-pipeline: | |
| runs-on: ubuntu-latest | |
| environment: vulmatch_tests | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Start docker-compose | |
| uses: hoverkraft-tech/compose-action@v2.0.2 | |
| id: start_container | |
| with: | |
| compose-file: | | |
| tests/st/docker-compose.yml | |
| compose-flags: | |
| --env-file tests/tests.env | |
| -p vulmatch-action | |
| - name: Get IP addresses | |
| id: get_ip | |
| run: | | |
| IP_ADDRESS=$(docker network inspect -f '{{range.IPAM.Config}}{{.Gateway}}{{end}}' vulmatch-action_default) | |
| echo "ip_address=$IP_ADDRESS" >> "$GITHUB_OUTPUT" | |
| echo "IP_ADDRESS=$IP_ADDRESS" >> "$GITHUB_OUTPUT" | |
| cat "$GITHUB_OUTPUT" | |
| - name: Setup environment | |
| id: setup_environment | |
| run: | | |
| pip install -r requirements.txt -r tests/requirements.txt | |
| echo ARANGODB_HOST_URL="http://${{ steps.get_ip.outputs.IP_ADDRESS }}:18529" >> tests/tests.env | |
| echo POSTGRES_HOST="${{ steps.get_ip.outputs.IP_ADDRESS }}" >> tests/tests.env | |
| echo DJANGO_WWW_PATH=$PWD/django_www_path/ >> tests/tests.env | |
| echo PYTHONPATH=. >> tests/tests.env | |
| echo "CTIBUTLER_BASE_URL=https://api.ctibutler.com/" >> tests/tests.env | |
| echo "CTIBUTLER_API_KEY=${{ secrets.CTIBUTLER_API_KEY }}" >> tests/tests.env | |
| echo "VULNCHECK_API_KEY=${{ secrets.VULNCHECK_API_KEY }}" >> tests/tests.env | |
| - name: Unit tests | |
| id: unit_tests | |
| run: | | |
| set -a; source tests/tests.env; set +a | |
| pytest --cov --cov-branch --cov-report=xml --junitxml=unittest.junit.xml -o junit_family=legacy tests/full tests/acvep -vv | |
| - name: Schema tests | |
| id: schema_tests | |
| if: ${{ failure() || success() }} | |
| run: | | |
| set -a; source tests/tests.env; set +a | |
| pytest --cov --cov-branch --cov-append --cov-report=xml --junitxml=schemathesis.junit.xml -o junit_family=legacy tests/st/test_schemathesis.py | |
| - name: Upload coverage reports to Codecov | |
| id: upload_unit_test_coverage | |
| if: ${{ !cancelled() }} | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Upload test results to Codecov | |
| id: upload_unit_test_results | |
| if: ${{ !cancelled() }} | |
| uses: codecov/test-results-action@v1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: unittest.junit.xml | |
| flags: unittest | |
| - name: Upload schemathesis test results to Codecov | |
| id: upload_schema_test_results | |
| if: ${{ !cancelled() }} | |
| uses: codecov/test-results-action@v1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: schemathesis.junit.xml | |
| flags: schemathesis |