-
Notifications
You must be signed in to change notification settings - Fork 14
Automate regression updates #1944
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
366a299
Automate regression updates
APJansen b4d2e72
Check out branch first
APJansen d8beb9d
Automatically regenerated regressions.
fc31604
continue test
APJansen 8735fc7
Add branch and PR in commit message
APJansen 8d3ecc0
Automatically regenerated regressions from PR 1944, branch automate-r…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,64 @@ | ||
| name: Redo regressions | ||
|
|
||
| # start job only for PRs when a label is added. | ||
| on: | ||
| pull_request: | ||
| types: [labeled] | ||
|
|
||
| # some general variables | ||
| env: | ||
| # https://keras.io/getting_started/faq/#how-can-i-obtain-reproducible-results-using-keras-during-development | ||
| PYTHONHASHSEED: "0" | ||
|
|
||
| jobs: | ||
| build: | ||
| if: contains(github.event.pull_request.labels.*.name, 'redo-regressions') | ||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-latest] | ||
| python-version: ["3.11"] | ||
| include: | ||
| - os: ubuntu-latest | ||
| CONDA_OS: linux-64 | ||
| fail-fast: false | ||
| runs-on: ${{ matrix.os }} | ||
| env: | ||
| NETRC_FILE: ${{ secrets.NETRC_FILE }} | ||
| NNPDF_SSH_KEY: ${{ secrets.NNPDF_SSH_KEY }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| ref: ${{ github.event.pull_request.head.ref }} | ||
|
|
||
| - uses: conda-incubator/setup-miniconda@v3 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| use-mamba: true | ||
| auto-update-conda: true | ||
| activate-environment: test | ||
| - name: Setup conda and install LHAPDF and pandoc | ||
| shell: bash -l {0} | ||
| run: | | ||
| echo "$NETRC_FILE" | base64 --decode > ~/.netrc | ||
| conda config --remove channels defaults | ||
| conda config --append channels conda-forge | ||
| conda config --prepend channels https://packages.nnpdf.science/public | ||
| conda config --set show_channel_urls true | ||
| conda install lhapdf pandoc | ||
| - name: Install nnpdf with testing and qed extras | ||
| shell: bash -l {0} | ||
| run: | | ||
| pip install .[qed,tests] | ||
| - name: Regenerate regressions | ||
| shell: bash -l {0} | ||
| run: | | ||
| pytest extra_tests/regression_checks.py --regenerate True | ||
| - name: Commit | ||
| shell: bash -l {0} | ||
| run: | | ||
| git config user.name "Redo regressions bot" | ||
| git add extra_tests/regression_fits/* | ||
| git status | ||
| git commit -m "Automatically regenerated regressions from PR ${{ github.event.number }}, branch ${{ github.event.pull_request.head.ref }}." | ||
| git push origin "${{ github.event.pull_request.head.ref }}" | ||
This file contains hidden or 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,14 @@ | ||
| """ | ||
| This enables the use of a command line argument to set regenerate, which is used to autmate the | ||
| regeneration of the regression data. | ||
| """ | ||
|
|
||
|
|
||
| def pytest_addoption(parser): | ||
| parser.addoption("--regenerate", action="store", default=False) | ||
|
|
||
|
|
||
| def pytest_generate_tests(metafunc): | ||
| option_value = metafunc.config.option.regenerate | ||
| if 'regenerate' in metafunc.fixturenames and option_value is not None: | ||
| metafunc.parametrize("regenerate", [option_value]) |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.