Skip to content

Commit

Permalink
changes tested for backend/prompt/root
Browse files Browse the repository at this point in the history
  • Loading branch information
kirtimanmishrazipstack committed Jul 17, 2024
1 parent 407cae8 commit 78d864e
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 155 deletions.
69 changes: 0 additions & 69 deletions .github/workflows/main.yaml

This file was deleted.

77 changes: 0 additions & 77 deletions .github/workflows/pdm-lock-automate-build.yaml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/pdm-lock-automation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Update PDM Lock Files

on:
push:


jobs:
backend_changes:
uses: ./.github/workflows/reusable-file-change-check.yaml
with:
file_path: backend/pyproject.toml

prompt_changes:
uses: ./.github/workflows/reusable-file-change-check.yaml
with:
file_path: prompt-service/pyproject.toml

root_changes:
uses: ./.github/workflows/reusable-file-change-check.yaml
with:
file_path: pyproject.toml

update-backend-pdm-lock:
needs: backend_changes
if: ${{ needs.backend_changes.outputs.changed == 'true' }}
uses: ./.github/workflows/reusable-update-pdm-lock.yaml
with:
service: 'backend'

update-prompt-service-pdm-lock:
needs: prompt_changes
if: ${{ needs.prompt_changes.outputs.changed == 'true' }}
uses: ./.github/workflows/reusable-update-pdm-lock.yaml
with:
service: 'prompt-service'

update-root-pdm-lock:
needs: root_changes
if: ${{ needs.root_changes.outputs.changed == 'true' }}
uses: ./.github/workflows/reusable-update-pdm-lock.yaml
with:
service:

# push-changes:
# needs: [update-backend-pdm-lock, update-prompt-service-pdm-lock, update-platform-service-pdm-lock, update-root-pdm-lock]
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3

# - name: Push changes
# run: git push
# if: success()
31 changes: 22 additions & 9 deletions .github/workflows/reusable-update-pdm-lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,41 @@ jobs:

- name: Update and add pdm.lock
run: |
echo "inside udpate pdm ${{ inputs.service }}";
if [ -n "${{ inputs.service }}" ]; then
cd ${{ inputs.service }}
fi
pdm venv create -w virtualenv --with-pip
echo "current dir before : "; pwd
echo "files in dir before : "; ls -al
if [ ! -d ".venv" ]; then
echo 'Creating virtual environment inside "${{ inputs.service }}".'
pdm venv create -w virtualenv --with-pip
else
echo "Virtual environment already exists."
fi
source .venv/bin/activate
pdm lock
# Debugging output
echo "curent dir: "; pwd
echo "Listing files in ${{ inputs.service || 'root' }} directory:"; ls -al | grep pdm.lock
echo "current dir after : "; pwd
echo "files in dir after : "; ls -al
git add pdm.lock
- name: Commit pdm.lock
- name: Running pre-commit and commit pdm.lock
run: |
echo "Dir: "; pwd
echo "LFiles in ${{ inputs.service || 'root' }} directory:"; ls -al
echo "current root dir: "; pwd
echo "files in root dir: "; ls -al
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
pdm venv create -w virtualenv --with-pip
if [ ! -d ".venv" ]; then
echo "Creating virtual environment inside root"
pdm venv create -w virtualenv --with-pip
else
echo "Virtual environment already exists."
fi
source .venv/bin/activate
pip install pre-commit~=3.6.2
Expand Down

0 comments on commit 78d864e

Please sign in to comment.