Skip to content

Commit 2897b91

Browse files
authored
[chore] Fix generate workflows task of loongsuite and add changelog file. (#68)
* Fix generate workflows task Change-Id: I570e3f8ea4810890df3e05bf01868f1d063d9a66 Co-developed-by: Cursor <[email protected]> * Rename CHANGELOG Change-Id: Ibdef56537fd575f7179948652213b0804ab40786 Co-developed-by: Cursor <[email protected]>
1 parent ce70afd commit 2897b91

File tree

6 files changed

+2410
-2191
lines changed

6 files changed

+2410
-2191
lines changed

.github/workflows/generate_workflows_lib/src/generate_workflows_lib/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def generate_extension_test_workflow(
278278
_generate_workflow_with_template(
279279
get_test_job_datas(loongsuite_envs, list(operating_systems)),
280280
"loongsuite_test",
281-
"test",
281+
"loongsuite_test",
282282
workflow_directory_path,
283283
)
284284

@@ -295,7 +295,7 @@ def generate_extension_lint_workflow(
295295
_generate_workflow_with_template(
296296
get_lint_job_datas(loongsuite_envs),
297297
"loongsuite_lint",
298-
"lint",
298+
"loongsuite_lint",
299299
workflow_directory_path,
300300
)
301301

@@ -312,7 +312,7 @@ def generate_extension_misc_workflow(
312312
_generate_workflow_with_template(
313313
get_misc_job_datas(loongsuite_envs),
314314
"loongsuite_misc",
315-
"misc",
315+
"loongsuite_misc",
316316
workflow_directory_path,
317317
)
318318

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Do not edit this file.
2+
# This file is generated automatically by executing tox -e generate-workflows
3+
4+
name: LoongSuite Lint {{ file_number }}
5+
6+
on:
7+
push:
8+
branches-ignore:
9+
- 'release/*'
10+
- 'otelbot/*'
11+
pull_request:
12+
13+
permissions:
14+
contents: read
15+
16+
concurrency:
17+
group: ${% raw %}{{ github.workflow }}-${{ github.head_ref || github.run_id }}{% endraw %}
18+
cancel-in-progress: true
19+
20+
env:
21+
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
22+
# For PRs you can change the inner fallback ('main')
23+
# For pushes you change the outer fallback ('main')
24+
# The logic below is used during releases and depends on having an equivalent branch name in the core repo.
25+
CORE_REPO_SHA: {% raw %}${{ github.event_name == 'pull_request' && (
26+
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
27+
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
28+
'main'
29+
) || 'main' }}{% endraw %}
30+
CONTRIB_REPO_SHA: main
31+
PIP_EXISTS_ACTION: w
32+
33+
jobs:
34+
{%- for job_data in job_datas %}
35+
36+
{{ job_data.name }}:
37+
name: LoongSuite {{ job_data.ui_name }}
38+
runs-on: ubuntu-latest
39+
timeout-minutes: 30
40+
steps:
41+
- name: Checkout repo @ SHA - ${% raw %}{{ github.sha }}{% endraw %}
42+
uses: actions/checkout@v4
43+
44+
- name: Set up Python 3.13
45+
uses: actions/setup-python@v5
46+
with:
47+
python-version: "3.13"
48+
49+
- name: Install tox
50+
run: pip install tox-uv
51+
52+
- name: Run tests
53+
run: tox -c tox-loongsuite.ini -e {{ job_data.tox_env }}
54+
{%- endfor %}
55+
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Do not edit this file.
2+
# This file is generated automatically by executing tox -e generate-workflows
3+
4+
name: LoongSuite Misc {{ file_number }}
5+
6+
on:
7+
push:
8+
branches-ignore:
9+
- 'release/*'
10+
- 'otelbot/*'
11+
pull_request:
12+
13+
permissions:
14+
contents: read
15+
16+
concurrency:
17+
group: ${% raw %}{{ github.workflow }}-${{ github.head_ref || github.run_id }}{% endraw %}
18+
cancel-in-progress: true
19+
20+
env:
21+
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
22+
# For PRs you can change the inner fallback ('main')
23+
# For pushes you change the outer fallback ('main')
24+
# The logic below is used during releases and depends on having an equivalent branch name in the core repo.
25+
CORE_REPO_SHA: {% raw %}${{ github.event_name == 'pull_request' && (
26+
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
27+
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
28+
'main'
29+
) || 'main' }}{% endraw %}
30+
CONTRIB_REPO_SHA: main
31+
PIP_EXISTS_ACTION: w
32+
33+
jobs:
34+
{%- for job_data in job_datas %}
35+
36+
{{ job_data }}:
37+
name: LoongSuite {{ job_data }}
38+
runs-on: ubuntu-latest
39+
timeout-minutes: 30
40+
{%- if job_data == "generate-workflows" %}
41+
if: |
42+
!contains(github.event.pull_request.labels.*.name, 'Skip generate-workflows')
43+
&& github.event.pull_request.user.login != 'otelbot[bot]' && github.event_name == 'pull_request'
44+
{%- endif %}
45+
{%- if job_data == "public-symbols-check" %}
46+
if: |
47+
!contains(github.event.pull_request.labels.*.name, 'Approve Public API check')
48+
&& github.actor != 'otelbot[bot]' && github.event_name == 'pull_request'
49+
{%- endif %}
50+
{%- if job_data == "docs" %}
51+
if: |
52+
github.event.pull_request.user.login != 'otelbot[bot]' && github.event_name == 'pull_request'
53+
{%- endif %}
54+
steps:
55+
- name: Checkout repo @ SHA - ${% raw %}{{ github.sha }}{% endraw %}
56+
uses: actions/checkout@v4
57+
{%- if job_data == "public-symbols-check" %}
58+
with:
59+
fetch-depth: 0
60+
61+
- name: Checkout main
62+
run: git checkout main
63+
64+
- name: Pull origin
65+
run: git pull --rebase=false origin main
66+
67+
- name: Checkout pull request
68+
run: git checkout ${% raw %}{{ github.event.pull_request.head.sha }}{% endraw %}
69+
{%- endif %}
70+
71+
- name: Set up Python 3.11
72+
uses: actions/setup-python@v5
73+
with:
74+
python-version: "3.11"
75+
76+
- name: Install tox
77+
run: pip install tox-uv
78+
79+
- name: Run tests
80+
run: tox -c tox-loongsuite.ini -e {{ job_data }}
81+
{%- if job_data == "generate-workflows" %}
82+
83+
- name: Check workflows are up to date
84+
run: git diff --exit-code || (echo 'Generated workflows are out of date, run "tox -e generate-workflows" and commit the changes in this PR.' && exit 1)
85+
{%- endif %}
86+
{%- if job_data == "generate" %}
87+
88+
- name: Check workflows are up to date
89+
run: git diff --exit-code || (echo 'Generated code is out of date, run "tox -e generate" and commit the changes in this PR.' && exit 1)
90+
{%- endif %}
91+
{%- endfor %}
92+
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Do not edit this file.
2+
# This file is generated automatically by executing tox -e generate-workflows
3+
4+
name: LoongSuite Test {{ file_number }}
5+
6+
on:
7+
push:
8+
branches-ignore:
9+
- 'release/*'
10+
- 'otelbot/*'
11+
pull_request:
12+
13+
permissions:
14+
contents: read
15+
16+
concurrency:
17+
group: ${% raw %}{{ github.workflow }}-${{ github.head_ref || github.run_id }}{% endraw %}
18+
cancel-in-progress: true
19+
20+
env:
21+
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
22+
# For PRs you can change the inner fallback ('main')
23+
# For pushes you change the outer fallback ('main')
24+
# The logic below is used during releases and depends on having an equivalent branch name in the core repo.
25+
CORE_REPO_SHA: {% raw %}${{ github.event_name == 'pull_request' && (
26+
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
27+
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
28+
'main'
29+
) || 'main' }}{% endraw %}
30+
CONTRIB_REPO_SHA: main
31+
PIP_EXISTS_ACTION: w
32+
33+
jobs:
34+
{%- for job_data in job_datas %}
35+
36+
{{ job_data.name }}:
37+
name: LoongSuite {{ job_data.ui_name }}
38+
runs-on: {{ job_data.os }}
39+
timeout-minutes: 30
40+
steps:
41+
- name: Checkout repo @ SHA - ${% raw %}{{ github.sha }}{% endraw %}
42+
uses: actions/checkout@v4
43+
44+
- name: Set up Python {{ job_data.python_version }}
45+
uses: actions/setup-python@v5
46+
with:
47+
python-version: "{{ job_data.python_version }}"
48+
49+
- name: Install tox
50+
run: pip install tox-uv
51+
{%- if job_data.os == "windows-latest" %}
52+
53+
- name: Configure git to support long filenames
54+
run: git config --system core.longpaths true
55+
{%- endif %}
56+
57+
- name: Run tests
58+
run: tox -c tox-loongsuite.ini -e {{ job_data.tox_env }} -- -ra
59+
{%- endfor %}
60+

0 commit comments

Comments
 (0)