|
41 | 41 | - 'Dockerfile' |
42 | 42 | - '.github/workflows/ci.yml' |
43 | 43 |
|
44 | | - lint: |
45 | | - timeout-minutes: 3 |
46 | | - runs-on: ubuntu-latest |
47 | | - |
48 | | - steps: |
49 | | - - name: Checkout repository |
50 | | - uses: actions/checkout@v6 |
51 | | - |
52 | | - - name: Set up Python |
53 | | - uses: actions/setup-python@v6 |
54 | | - with: |
55 | | - python-version: ${{ env.PYTHON_VERSION }} |
56 | | - |
57 | | - - name: Cache Poetry, pipx, and dependencies |
58 | | - uses: actions/cache@v5 |
59 | | - with: |
60 | | - path: | |
61 | | - ~/.local/pipx |
62 | | - ~/.cache/pypoetry |
63 | | - ~/.cache/pip |
64 | | - ~/.cache/ms-playwright |
65 | | - key: setup-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.POETRY_VERSION }}-${{ hashFiles('**/poetry.lock') }} |
66 | | - restore-keys: | |
67 | | - setup-${{ runner.os }}-${{ env.PYTHON_VERSION }}- |
68 | | -
|
69 | | - - name: Ensure Poetry is available |
70 | | - run: | |
71 | | - python -m pip install --upgrade pip pipx |
72 | | - pipx install poetry==${POETRY_VERSION} |
73 | | - echo "$(pipx environment --value PIPX_BIN_DIR)" >> $GITHUB_PATH |
74 | | -
|
75 | | - - name: Create virtual environment |
76 | | - run: python -m venv .venv |
77 | | - |
78 | | - - name: Activate virtual environment and confirm it's active |
79 | | - run: | |
80 | | - source .venv/bin/activate |
81 | | - PYTHON_PATH=$(which python) |
82 | | - if [[ "$PYTHON_PATH" == *".venv"* ]]; then |
83 | | - echo "Python is using a .venv environment: $PYTHON_PATH" |
84 | | - else |
85 | | - echo "Python is NOT using a .venv environment: $PYTHON_PATH" |
86 | | - exit 1 |
87 | | - fi |
88 | | -
|
89 | | - - name: Install dependencies |
90 | | - run: | |
91 | | - source .venv/bin/activate |
92 | | - poetry install --no-root --with format |
93 | | -
|
94 | | - - name: Check for successful installation |
95 | | - run: | |
96 | | - source .venv/bin/activate |
97 | | - poetry check |
98 | | -
|
99 | | - - name: Format and lint project |
100 | | - run: | |
101 | | - source .venv/bin/activate |
102 | | - poetry run python tasks/format.py --dry-run |
103 | | -
|
104 | 44 | test: |
105 | 45 | timeout-minutes: 6 |
106 | 46 | runs-on: ubuntu-latest |
@@ -172,20 +112,7 @@ jobs: |
172 | 112 | source .venv/bin/activate |
173 | 113 | poetry install --no-root --with test |
174 | 114 |
|
175 | | -
|
176 | | - - name: Run API tests |
177 | | - run: poetry run pytest -rfsxE --capture=no --log-cli-level=DEBUG --maxfail=1 ./test/test__server__api.py |
178 | | - |
179 | | - |
180 | 115 | - name: Install Playwright browser |
181 | 116 | run: | |
182 | 117 | poetry run playwright install --with-deps chromium |
183 | 118 |
|
184 | | - - name: Run Web UI tests |
185 | | - run: poetry run pytest -rfsxE --capture=no --log-cli-level=DEBUG --maxfail=1 --tracing=retain-on-failure ./test/test__server__web_ui.py |
186 | | - |
187 | | - - uses: actions/upload-artifact@v7 |
188 | | - if: ${{ !cancelled() && hashFiles('test-results/**') != '' }} |
189 | | - with: |
190 | | - name: playwright-traces |
191 | | - path: test-results/ |
0 commit comments