|
1 | | -name: Run Tests (On Push) |
| 1 | +name: Run Tests |
2 | 2 | on: |
3 | 3 | push: |
| 4 | + # Run all tests on main, fast tests on other branches |
4 | 5 |
|
5 | 6 | env: |
6 | 7 | LOG_CONFIG: test |
|
50 | 51 | - run: pip install --upgrade pip |
51 | 52 | - run: pip install poetry |
52 | 53 | - run: poetry install --with dev |
53 | | - - run: poetry run pytest tests/ |
| 54 | + - name: Run fast tests on non-main branches |
| 55 | + if: github.event_name == 'push' && github.ref != 'refs/heads/main' |
| 56 | + run: poetry run pytest tests/ -m "not network and not slow" |
| 57 | + - name: Run full tests on main |
| 58 | + if: github.event_name == 'push' && github.ref == 'refs/heads/main' |
| 59 | + run: poetry run pytest tests/ |
54 | 60 |
|
55 | 61 | run-tests-3_11: |
56 | 62 | runs-on: ubuntu-latest |
|
66 | 72 | - run: pip install --upgrade pip |
67 | 73 | - run: pip install poetry |
68 | 74 | - run: poetry install --with dev --extras server |
69 | | - - run: poetry run pytest tests/ --show-capture=stdout --cov=src |
| 75 | + - name: Run fast tests on non-main branches |
| 76 | + if: github.ref != 'refs/heads/main' |
| 77 | + run: poetry run pytest tests/ -m "not network and not slow" --show-capture=stdout |
| 78 | + - name: Run all tests with coverage on main branch |
| 79 | + if: github.ref == 'refs/heads/main' |
| 80 | + run: poetry run pytest tests/ --show-capture=stdout --cov=src |
70 | 81 |
|
71 | 82 | run-tests-3_12-core-dependencies: |
72 | 83 | runs-on: ubuntu-latest |
|
80 | 91 | - run: pip install --upgrade pip |
81 | 92 | - run: pip install poetry |
82 | 93 | - run: poetry install --with dev |
83 | | - - run: poetry run pytest tests/ |
| 94 | + - name: Run fast tests on non-main branches |
| 95 | + if: github.ref != 'refs/heads/main' |
| 96 | + run: poetry run pytest tests/ -m "not network and not slow" |
| 97 | + - name: Run all tests on main branch |
| 98 | + if: github.ref == 'refs/heads/main' |
| 99 | + run: poetry run pytest tests/ |
84 | 100 |
|
85 | 101 | run-tests-3_12: |
86 | 102 | runs-on: ubuntu-latest |
|
96 | 112 | - run: pip install --upgrade pip |
97 | 113 | - run: pip install poetry |
98 | 114 | - run: poetry install --with dev --extras server |
99 | | - - run: poetry run pytest tests/ --show-capture=stdout --cov=src |
| 115 | + - name: Run fast tests on non-main branches |
| 116 | + if: github.ref != 'refs/heads/main' |
| 117 | + run: poetry run pytest tests/ -m "not network and not slow" --show-capture=stdout |
| 118 | + - name: Run all tests with coverage on main branch |
| 119 | + if: github.ref == 'refs/heads/main' |
| 120 | + run: poetry run pytest tests/ --show-capture=stdout --cov=src |
0 commit comments