Nightly Full AMMR tests #20
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
name: Nightly Full AMMR tests | |
on: | |
schedule: | |
- cron: 0 3 * * * | |
workflow_dispatch: | |
inputs: | |
force-update-durations: | |
type: boolean | |
description: 'Force creation of new .test-duration files and create a PR with them. Default is false.' | |
default: false | |
concurrency: | |
group: ci-nightly-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test-windows: | |
if: github.repository == 'anybody/ammr' | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
test_group: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] | |
env: | |
# Triggers a warning at 20 deg muscles discretization angles | |
# I.e. wrapping on very small sharp corners | |
ShortestPathMaxAngle: 0.3491 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: prefix-dev/[email protected] | |
with: | |
environments: test | |
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'master' }} | |
- name: Run full AMMR tests | |
run: | | |
cd Tests | |
pytest -n auto --dist worksteal ` | |
--splits 10 --group ${{ matrix.test_group }} --splitting-algorithm=least_duration ` | |
--durations=20 ` | |
--store-durations --clean-durations ` | |
--runslow | |
shell: pwsh -command "pixi run -e test pwsh '{0}'" | |
env: | |
RLM_LICENSE_PASSWORD: ${{ secrets.LICENSE_PASSWORD }} | |
RLM_LICENSE: ${{ secrets.LICENSE_SERVER }} | |
- name: Upload partial durations | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-durations-${{ matrix.test_group }} | |
path: | | |
Tests\.test_durations | |
retention-days: 1 | |
test-linux: | |
if: github.repository == 'anybody/ammr' | |
runs-on: ubuntu-latest | |
container: ghcr.io/anybody/anybodycon-github-actions:8.0 | |
env: | |
ANYBODY_SUPPRESS_DEPRECATION_MESSAGES: "Off" | |
strategy: | |
fail-fast: false | |
matrix: | |
test_group: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set debug env vars | |
run: echo ${{ github.event.inputs.debug_config }} >> $GITHUB_ENV | |
- uses: prefix-dev/[email protected] | |
with: | |
environments: test | |
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'master' }} | |
- name: Run tests | |
run: | | |
cd Tests | |
pytest -n auto \ | |
--splits 10 --group ${{ matrix.test_group }} --splitting-algorithm=least_duration \ | |
--only-load \ | |
--runslow | |
shell: pixi run -e test bash {0} | |
env: | |
RLM_LICENSE_PASSWORD: ${{ secrets.LICENSE_PASSWORD }} | |
RLM_LICENSE: ${{ secrets.LICENSE_SERVER }} | |
combine-and-upload-timings: | |
runs-on: ubuntu-latest | |
needs: [test-windows] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
- name: Combine test-durations | |
run: | | |
import json, pathlib | |
data = {} | |
for file in pathlib.Path.cwd().glob("test-durations-*/*"): | |
data.update(json.loads(file.read_text())) | |
data = {k: v for k, v in sorted(data.items(), key=lambda x: x[1], reverse=True)} | |
test_durations = pathlib.Path('Tests/.test_durations') | |
if set(data) != set(json.loads(test_durations.read_text())) or "${{ github.event.inputs.force-update-durations }}" == "true": | |
test_durations.write_text(json.dumps(data, indent=2)) | |
shell: python | |
- name: Create updated durations PR | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
push-to-fork: anybody-bot/ammr | |
token: ${{ secrets.DURATIONS_TOKEN }} | |
branch: update-durations | |
add-paths: Tests/.test_durations | |
delete-branch: true | |
commit-message: Update test durations | |
author: AnyBody Bot <[email protected]> | |
committer: AnyBody Bot <[email protected]> | |
title: 🤖 Update test durations | |
body: | | |
The tests suite has changed and I have collected the newest test durations | |
from yesterdays nightly test. This PR updates the `Tests/.test_durations` file. | |
[nightly-tests.yml]: ${{ github.server_url }}/${{ github.repository }}/blob/main/.github/workflows/nightly-tests.yml | |
This PR was created automatically by the [`nightly-tests.yml`][nightly-tests.yml] workflow. |