Skip to content

PySR backend update #1138

PySR backend update

PySR backend update #1138

name: PySR backend update
on:
schedule:
- cron: '00 00 * * *'
workflow_dispatch:
permissions:
contents: write
pull-requests: write
actions: write
jobs:
update_compat:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3'
cache: pip
- name: "Install dependencies"
run: python -m pip install --upgrade pip
- name: "Get SymbolicRegression.jl latest version"
id: get-latest
run: |
cd $(mktemp -d)
git clone https://github.com/MilesCranmer/SymbolicRegression.jl
cd SymbolicRegression.jl
echo "version=$(git describe --tags --match='v*' --abbrev=0 | sed 's/^v//')" >> $GITHUB_OUTPUT
- name: "Update SymbolicRegression.jl version in PySR"
run: |
python .github/workflows/update_backend_version.py ${{ steps.get-latest.outputs.version }}
- name: "Create PR if necessary"
id: cpr
uses: peter-evans/create-pull-request@v8
with:
branch: backend-update/v${{ steps.get-latest.outputs.version }}
title: "chore: update backend to v${{ steps.get-latest.outputs.version }}"
body: |
This PR was automatically generated by the GitHub Action `.github/workflows/update-backend.yml`
It updates the backend version to v${{ steps.get-latest.outputs.version }}. For a full description of the changes, see the backend changelog: [v${{ steps.get-latest.outputs.version }}](https://github.com/MilesCranmer/SymbolicRegression.jl/releases/tag/v${{ steps.get-latest.outputs.version }}).
delete-branch: true
commit-message: "chore: update backend to v${{ steps.get-latest.outputs.version }}"
add-paths: |
pysr/juliapkg.json
- name: "Trigger CI workflows (backend update PR)"
if: steps.cpr.outputs.pull-request-number != ''
env:
GH_TOKEN: ${{ github.token }}
run: |
ref="backend-update/v${{ steps.get-latest.outputs.version }}"
gh workflow run "Linux" --repo "$GITHUB_REPOSITORY" --ref "$ref" || true
gh workflow run "Windows" --repo "$GITHUB_REPOSITORY" --ref "$ref" || true
gh workflow run "macOS" --repo "$GITHUB_REPOSITORY" --ref "$ref" || true
gh workflow run "Docker" --repo "$GITHUB_REPOSITORY" --ref "$ref" || true
gh workflow run "Apptainer" --repo "$GITHUB_REPOSITORY" --ref "$ref" || true
gh workflow run "Documentation" --repo "$GITHUB_REPOSITORY" --ref "$ref" || true
gh workflow run "CodeQL" --repo "$GITHUB_REPOSITORY" --ref "$ref" || true