Skip to content

Commit

Permalink
ci: speed up pip install
Browse files Browse the repository at this point in the history
  • Loading branch information
tdstein committed May 30, 2024
1 parent 8902884 commit c778fd0
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 24 deletions.
30 changes: 8 additions & 22 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: CI
on:
- push
- pull_request
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.head_ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
Expand All @@ -15,28 +17,10 @@ jobs:
python-version: 3.x
check-latest: true
cache: 'pip'
- uses: yezz123/setup-uv@v4
- run: make deps
- run: make lint

cov:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
check-latest: true
cache: 'pip'
- run: make deps
- run: make dev
- run: make test
- run: make cov-xml
- uses: orgoro/[email protected]
with:
coverageFile: coverage.xml
thresholdAll: 0.8
token: ${{ secrets.GITHUB_TOKEN }}

test:
runs-on: ubuntu-latest
strategy:
Expand All @@ -55,6 +39,7 @@ jobs:
python-version: ${{ matrix.python-version }}
check-latest: true
cache: 'pip'
- uses: yezz123/setup-uv@v4
- run: make deps
- run: make dev
- run: make test
Expand All @@ -68,5 +53,6 @@ jobs:
python-version: 3.x
check-latest: true
cache: 'pip'
- uses: yezz123/setup-uv@v4
- run: make deps
- run: make build
25 changes: 25 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Coverage
on:
- pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
cov:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
check-latest: true
cache: 'pip'
- run: make deps
- run: make dev
- run: make test
- run: make cov-xml
- uses: orgoro/[email protected]
with:
coverageFile: coverage.xml
thresholdAll: 0.8
token: ${{ secrets.GITHUB_TOKEN }}
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@
NAME := posit-sdk

# Command aliases
PIP := pip3
PYTHON := python3

# Check if 'uv' is available
ifneq ($(shell command -v uv 2>/dev/null),)
PIP := uv pip
else
PIP := pip3
endif

.PHONY:
build
clean
Expand Down Expand Up @@ -52,7 +58,7 @@ cov-xml:

# Target for installing project dependencies
deps:
$(PIP) install -r requirements.txt -r requirements-dev.txt
$(PIP) install --upgrade pip setuptools wheel -r requirements.txt -r requirements-dev.txt

# Target for installing the project in editable mode
dev:
Expand Down

0 comments on commit c778fd0

Please sign in to comment.