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