Skip to content

Commit 3335346

Browse files
committed
Updated workflows to use UV
1 parent 5e84819 commit 3335346

File tree

2 files changed

+21
-24
lines changed

2 files changed

+21
-24
lines changed

.github/workflows/ruff_linter.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,12 @@ jobs:
2828
2929
- name: Create virtual environment and install dependencies
3030
run: |
31-
# Create a virtual environment
3231
uv venv
33-
uv pip install -e .
32+
uv pip install -e .[dev]
3433
if [ -f requirements.txt ]; then uv pip install -r requirements.txt; fi
35-
uv pip install ruff pytest
36-
37-
- name: Install system dependencies for X11
38-
run: |
39-
sudo apt-get update
40-
sudo apt-get install -y xvfb
34+
uv pip install ruff
4135
4236
- name: Run Ruff
4337
run: |
4438
source .venv/bin/activate
45-
uv run ruff check .
46-
47-
- name: Run Tests
48-
run: |
49-
source .venv/bin/activate
50-
xvfb-run -a uv run pytest tests/
39+
uv run ruff check .

.github/workflows/ubuntu.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,34 @@ jobs:
1717

1818
steps:
1919
- uses: actions/checkout@v4
20+
2021
- name: Set up Python ${{ matrix.python-version }}
2122
uses: actions/setup-python@v3
2223
with:
2324
python-version: ${{ matrix.python-version }}
2425

25-
- name: Install xvfb
26-
run: sudo apt-get install -y xvfb
26+
- name: Install system dependencies for X11
27+
run: |
28+
sudo apt-get update
29+
sudo apt-get install -y xvfb
30+
31+
- name: Install uv
32+
run: |
33+
curl -LsSf https://astral.sh/uv/install.sh | sh
34+
echo "${HOME}/.cargo/bin" >> $GITHUB_PATH
2735
28-
- name: Install dependencies
36+
- name: Create virtual environment and install dependencies
2937
run: |
30-
python -m pip install --upgrade pip
31-
python -m pip install flake8 pytest
32-
python -m pip install .[dev]
33-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
38+
uv venv
39+
uv pip install -e .[dev]
40+
if [ -f requirements.txt ]; then uv pip install -r requirements.txt; fi
41+
uv pip install flake8 pytest pytest-cov
3442
3543
- name: Lint with flake8
3644
run: |
37-
flake8 drone_base/ --count --select=E9,F63,F7,F82 --show-source --statistics
38-
flake8 drone_base/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
45+
uv run flake8 drone_base/ --count --select=E9,F63,F7,F82 --show-source --statistics
46+
uv run flake8 drone_base/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
3947
4048
- name: Run tests with pytest and coverage
4149
run: |
42-
xvfb-run -a pytest --cov=drone_base --cov-report=xml
50+
xvfb-run -a uv run pytest --cov=drone_base --cov-report=xml

0 commit comments

Comments
 (0)