-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* split by major/minor * fix linting * try to fix unique directory constraint * try to fix unique directory constraint * condense into one block * removing junk config * Add pip-compile workflow * added major/minor groups * fixed default branch for compile * change file type for workflow
- Loading branch information
Showing
2 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Compile Requirements with Docker | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
branches: | ||
- dev | ||
workflow_dispatch: # Allows manual triggering | ||
|
||
jobs: | ||
compile-requirements: | ||
if: github.actor == 'dependabot[bot]' || github.event_name == 'workflow_dispatch' # Run for Dependabot PRs or manual trigger | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Run pip-compile in Docker | ||
run: | | ||
docker run --platform linux/amd64 \ | ||
-v ${{ github.workspace }}:/opt/metamist \ | ||
--workdir /opt/metamist \ | ||
--rm python:3.10-slim bash -c " \ | ||
pip install pip-tools && \ | ||
echo 'Installed pip-tools!'; \ | ||
echo 'Compiling from requirements.in'; \ | ||
pip-compile requirements.in > requirements.txt && \ | ||
echo 'Compiling from requirements-dev.in'; \ | ||
pip-compile --output-file=requirements-dev.txt requirements-dev.in requirements.in" | ||
- name: Commit updated requirements files | ||
run: | | ||
git config --local user.name "github-actions[bot]" | ||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
git add requirements.txt requirements-dev.txt | ||
git commit -m "Auto-compile requirements.txt and requirements-dev.txt" | ||
git push | ||
continue-on-error: true |