Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge build and update into single file #21

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/scripts/update_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ for version in "${PYTHON_VERSIONS[@]}"; do
# Install pru into the virtual environment
pip install pru

# Calculate checksums before running pru
# Get minor version
minor_version=$(python${version} -c "import sys; print(f'{sys.version_info.minor}')")

# Calculate checksums before running pru
checksum_before_single=$(md5sum "pytests/requirements/3_${minor_version}/requirements_single_updated.txt" | cut -d ' ' -f 1)
checksum_before_mix=$(md5sum "pytests/requirements/3_${minor_version}/requirements_mix_updated.txt" | cut -d ' ' -f 1)

Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,32 @@ jobs:
- name: Fail the job if tests fail
if: steps.pytest.outcome != 'success' && steps.pytest2.outcome != 'success'
run: exit 1

update:
needs: build
if: needs.build.result != 'success'
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.12

- name: Check out repository
uses: actions/checkout@v4

- name: Run requirements updater script
id: run_pru
run: |
bash .github/scripts/update_requirements.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Commit and push changes
if: steps.run_pru.outputs.updated == 'true'
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git add .
git commit -m "Update requirements based on failed tests at $(date)"
git push origin HEAD
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ jobs:
- name: Install package
run: pip install -e ."[dev]"

- name: Test package
- name: Run tests
id: pytest
run: |
python3 -m pytest . -c pyproject.toml
continue-on-error: true

- name: Test package 2
- name: Run tests with last failed
id: pytest2
if: steps.pytest.outcome != 'success'
run: |
Expand Down
61 changes: 0 additions & 61 deletions .github/workflows/update.yml

This file was deleted.

Loading