Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kirtimanmishrazipstack committed Jul 16, 2024
1 parent 5f8fd17 commit c130b81
Showing 1 changed file with 40 additions and 22 deletions.
62 changes: 40 additions & 22 deletions .github/workflows/pdm-lock-automate-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,57 +3,75 @@ name: Update PDM Lock Files
on:
push:
paths:
- 'unstract/**/pyproject.toml'
- '**/pyproject.toml' # Watch for changes in any pyproject.toml file


jobs:
update-pdm-lock:
runs-on: ubuntu-latest

strategy:
matrix:
service: [backend, prompt-service, platform-service]
# service: [backend, prompt-service, platform-service]
service: [backend, prompt-service]

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.9.0'
python-version: '3.9'

- name: Install PDM
run: python -m pip install pdm

- name: Update pdm.lock for ${{ matrix.service }}
run: |
cd unstract/${{ matrix.service }}
pdm venv create -w virtualenv --with-pip
source .venv/bin/activate
pdm lock

- name: Update pdm.lock for root directory
- name: Create virtual environment
run: pdm venv create -w virtualenv --with-pip

- name: Update pdm.lock for ${{ matrix.service }}
run: |
cd unstract
cd ${{ matrix.service }}
pdm venv create -w virtualenv --with-pip
source .venv/bin/activate
pdm lock
- name: Commit changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
# Commit changes for each service directory
cd unstract/${{ matrix.service }}
git add pdm.lock
git commit -m "Update pdm.lock for ${{ matrix.service }}"
# Commit changes for root directory
cd ..
# Debugging output
echo "Listing matrix dir name:"; pwd
echo "Listing files in matrix directory:"; ls -al | grep pdm.lock
- name: Update pdm.lock for root
run: |
source .venv/bin/activate
pdm lock
git add pdm.lock
git commit -m "Update pdm.lock for root directory"
# Debugging output
echo "Listing root dir name:"; pwd
echo "Listing files in root directory:"; ls -al | grep pdm.lock
- name: Activate virtual environment and install pre-commit
run: |
source .venv/bin/activate
python -m pip install --upgrade pip
pip install pre-commit~=3.6.2
- name: Run pre-commit hooks and commit pdm lock changes
run: |
source .venv/bin/activate
git add .pre-commit-config.yaml
pre-commit run
git commit -m "Adding pdm.lock for root directory"
- name: Push changes
run: git push
run: |
echo "yes" | git push [email protected]:${{ github.repository }} HEAD:${{ github.ref }}
if: success()

0 comments on commit c130b81

Please sign in to comment.