Skip to content

Commit e67b6af

Browse files
authored
Merge branch 'psds-cpp:main' into main
2 parents 1e6cb80 + a861a82 commit e67b6af

25 files changed

Lines changed: 2581 additions & 7 deletions

.github/workflows/testing.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ jobs:
3131
"swap_ptr" "func_array" "longest" "last_of_us" "little_big" "pretty_array"
3232
"data_stats" "unique" "range" "minmax" "find_all" "os_overload" "easy_compare" "filter" "enum_operators"
3333
"stack" "queue" "ring_buffer" "phasor"
34-
"tracer" "string_view" "cow_string" "simple_vector")
34+
"tracer" "string_view" "cow_string" "simple_vector"
35+
"unique_ptr" "smart_ptr" "simple_list"
36+
)
3537
3638
declare -i passed_count=0
3739
declare -i failed_count=0

.github/workflows/testing_week_01.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Determine tasks to run
3737
id: get-tasks
3838
run: |
39-
if [["${{ github.event_name }}" = "schedule"]] ||
39+
if [[ "${{ github.event_name }}" = "schedule" ]] ||
4040
[[ "${{ github.event.inputs.tasks }}" = "all" ]]; then
4141
# Find all tasks
4242
TASKS=()

.github/workflows/testing_week_02.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Determine tasks to run
3636
id: get-tasks
3737
run: |
38-
if [["${{ github.event_name }}" = "schedule"]] ||
38+
if [[ "${{ github.event_name }}" = "schedule" ]] ||
3939
[[ "${{ github.event.inputs.tasks }}" = "all" ]]; then
4040
# Find all tasks
4141
TASKS=()

.github/workflows/testing_week_03.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Determine tasks to run
3939
id: get-tasks
4040
run: |
41-
if [["${{ github.event_name }}" = "schedule"]] ||
41+
if [[ "${{ github.event_name }}" = "schedule" ]] ||
4242
[[ "${{ github.event.inputs.tasks }}" = "all" ]]; then
4343
# Find all tasks
4444
TASKS=()

.github/workflows/testing_week_04.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Determine tasks to run
3434
id: get-tasks
3535
run: |
36-
if [["${{ github.event_name }}" = "schedule"]] ||
36+
if [[ "${{ github.event_name }}" = "schedule" ]] ||
3737
[[ "${{ github.event.inputs.tasks }}" = "all" ]]; then
3838
# Find all tasks
3939
TASKS=()

.github/workflows/testing_week_05.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
- simple_vector
1717

1818
schedule:
19-
- cron: '59 20 16 02 *' # UTC: 20:59 = 23:59 MSK 16 February
19+
- cron: '59 20 17 02 *' # UTC: 20:59 = 23:59 MSK 17 February
2020

2121
jobs:
2222
test:
@@ -33,7 +33,7 @@ jobs:
3333
- name: Determine tasks to run
3434
id: get-tasks
3535
run: |
36-
if [["${{ github.event_name }}" = "schedule"]] ||
36+
if [[ "${{ github.event_name }}" = "schedule" ]] ||
3737
[[ "${{ github.event.inputs.tasks }}" = "all" ]]; then
3838
# Find all tasks
3939
TASKS=()
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Testing Tasks Week 06
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tasks:
7+
description: 'Select tasks to test'
8+
required: true
9+
type: choice
10+
default: 'all'
11+
options:
12+
- all
13+
- unique_ptr
14+
- smart_ptr
15+
- simple_list
16+
17+
schedule:
18+
- cron: '59 20 23 02 *' # UTC: 20:59 = 23:59 MSK 23 February
19+
20+
jobs:
21+
test:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Install compiler and CMake
27+
run: sudo apt install -y cmake build-essential g++-14 libgtest-dev libgmock-dev
28+
29+
- name: Configure project
30+
run: cmake -B build
31+
32+
- name: Determine tasks to run
33+
id: get-tasks
34+
run: |
35+
if [[ "${{ github.event_name }}" = "schedule" ]] ||
36+
[[ "${{ github.event.inputs.tasks }}" = "all" ]]; then
37+
# Find all tasks
38+
TASKS=()
39+
for dir in 06_week/tasks/*/; do
40+
task=$(basename "$dir")
41+
TASKS+=("$task")
42+
done
43+
echo "tasks=${TASKS[*]}" >> $GITHUB_OUTPUT
44+
else
45+
# Используем указанную задачу
46+
echo "tasks=${{ github.event.inputs.tasks }}" >> $GITHUB_OUTPUT
47+
fi
48+
49+
- name: Build and run tests for selected tasks
50+
run: |
51+
echo "Event: ${{ github.event_name }}"
52+
echo "Tasks to test: '${{ steps.get-tasks.outputs.tasks }}'"
53+
54+
IFS=' ' read -ra tasks <<< "${{ steps.get-tasks.outputs.tasks }}"
55+
56+
declare -i passed_count=0
57+
declare -i failed_count=0
58+
declare -i task_count=0
59+
60+
# task name arrays
61+
passed_tasks=()
62+
failed_tasks=()
63+
64+
echo "=== Starting tests for selected tasks ==="
65+
66+
for task in "${tasks[@]}"; do
67+
task_count+=1
68+
echo "=== Processing $task ==="
69+
70+
if cmake --build build --target test_$task; then
71+
echo "✅ test_$task built successfully"
72+
73+
if ./build/tasks/test_$task; then
74+
echo "✅ test_$task PASSED"
75+
passed_count+=1
76+
passed_tasks+=("$task")
77+
else
78+
echo "❌ test_$task FAILED"
79+
failed_count+=1
80+
failed_tasks+=("$task")
81+
fi
82+
else
83+
echo "❌ test_$task build FAILED"
84+
failed_count+=1
85+
failed_tasks+=("$task")
86+
fi
87+
done
88+
89+
echo "=== Test Results Summary ==="
90+
echo "Total tasks in list: ${#tasks[@]}"
91+
echo "Processed: $task_count"
92+
echo "✅ Passed: $passed_count [$(echo ${passed_tasks[@]} | tr ' ' ', ')]"
93+
echo "❌ Failed: $failed_count [$(echo ${failed_tasks[@]} | tr ' ' ', ')]"
94+
95+
if [ $failed_count -gt 0 ]; then
96+
echo "❌ Some tasks failed!"
97+
exit 1
98+
elif [ $task_count -eq 0 ]; then
99+
echo "No tasks were processed (no changes)"
100+
exit 0
101+
else
102+
echo "✅ All processed tasks passed!"
103+
exit 0
104+
fi

0 commit comments

Comments
 (0)