Skip to content

Commit

Permalink
ci: fix alternative version installation (#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
adhtruong committed Sep 28, 2023
1 parent cabe03c commit 8ef78b8
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 113 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,29 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Create cache file
run: echo '${{ matrix.pydantic-version }}-${{ matrix.sqla-version }}' > ./matrix-file.txt

- uses: pdm-project/setup-pdm@v3
name: Set up PDM
with:
python-version: ${{ matrix.python-version }}
allow-python-prereleases: true
cache: true

- name: Install dependencies
run: pdm install -G:all
cache-dependency-path: |
./pdm.lock
./matrix-file.txt
- name: Install pydantic
if: matrix.pydantic-version == '1.10'
run: source .venv/bin/activate && pip install "pydantic==1.10.10" && pip uninstall pydantic_core -y
run: pdm add --no-sync -G pydantic "pydantic[email]==1.10.10"

- name: Install SQLAlchemy
if: matrix.sqla-version == '1.4'
run: source .venv/bin/activate && pip install "sqlalchemy==1.4.49"
run: pdm add --no-sync -G sqlalchemy "sqlalchemy==1.4.49"

- name: Install dependencies
run: pdm sync -G:all

- name: Set pythonpath
run: echo "PYTHONPATH=$PWD" >> $GITHUB_ENV
Expand Down
Loading

0 comments on commit 8ef78b8

Please sign in to comment.