DVX-182: Run integration tests in parallel #5
Workflow file for this run
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: Pytest cron job | |
on: | |
pull_request: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 1 * * *' # At 01:00 Daily | |
jobs: | |
build: | |
concurrency: integration_tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.9"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi | |
- name: QA checks (black, flake8, mypy) | |
run: | | |
./qa-checks | |
- name: Test with pytest | |
env: # Or as an environment variable | |
ATLAN_API_KEY: ${{ secrets.ATLAN_API_KEY }} | |
ATLAN_BASE_URL: ${{ secrets.ATLAN_BASE_URL }} | |
MARK_API_KEY: ${{ secrets.MARK_ATLAN_API_KEY }} | |
MARK_BASE_URL: https://mark.atlan.com | |
run: | | |
pytest tests/unit | |
pytest tests/integration/connection_test.py --ignore tests/integration/data_mesh_test.py --store-durations | |
- name: Check for changes in .test_durations | |
if: success() | |
run: | | |
if [ -n "$(git diff --exit-code .test_durations)" ]; then | |
echo "Changes detected in .test_durations" | |
else | |
echo "No changes in .test_durations, exiting." | |
exit 78 # 78 is used as a custom exit code to skip subsequent steps | |
fi | |
- name: Commit and push test durations on success | |
if: success() | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Actions" | |
git add .test_durations | |
git commit -m "Update test durations" | |
git push |