-
Notifications
You must be signed in to change notification settings - Fork 11
145 lines (116 loc) · 4.58 KB
/
nightly-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
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/ammr4-beta'
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/setup-pixi@v0.8.1
with:
environments: test
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'ammr4-beta' }}
activate-environment: test
- 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
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
include-hidden-files: true
retention-days: 1
test-linux:
if: github.repository == 'anybody/ammr4-beta'
runs-on: ubuntu-latest
container: ghcr.io/anybody/anybodycon-github-actions:8.0.5rc1
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/setup-pixi@v0.8.1
with:
environments: test
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'ammr4-beta' }}
activate-environment: test
- name: Run tests
run: |
cd Tests
pytest -n auto \
--splits 10 --group ${{ matrix.test_group }} --splitting-algorithm=least_duration \
--only-load \
--runslow
env:
RLM_LICENSE_PASSWORD: ${{ secrets.LICENSE_PASSWORD }}
RLM_LICENSE: ${{ secrets.LICENSE_SERVER }}
combine-and-upload-timings:
runs-on: ubuntu-latest
needs: [test-windows]
if: github.repository == 'anybody/ammr'
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@v7
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 <149305714+anybody-bot@users.noreply.github.com>
committer: AnyBody Bot <149305714+anybody-bot@users.noreply.github.com>
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.