Skip to content

Commit f5a4e4a

Browse files
committed
core: validate, deploy yaml fix
1 parent feeb601 commit f5a4e4a

File tree

2 files changed

+11
-54
lines changed

2 files changed

+11
-54
lines changed

.github/workflows/datastructures-algorithms-tag-and-release.yaml renamed to .github/workflows/datastructures-algorithms-deploy.yaml

Lines changed: 3 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: datastructures-algorithms-tag-and-release
1+
name: datastructures-algorithms-deploy
22

33
# Triggers only when a PR to 'main' is closed
44
on:
@@ -13,57 +13,9 @@ permissions:
1313
pull-requests: read # To read the PR body
1414

1515
jobs:
16-
# --- Job 1: Lint, Build, and Test ---
17-
lint-build-test:
18-
# This job only runs if the PR was actually merged
19-
if: github.event.pull_request.merged == true
20-
runs-on: windows-latest
21-
22-
steps:
23-
- name: Checkout code
24-
uses: actions/checkout@v4 # Use v4
25-
26-
- name: Setup MSVC
27-
uses: ilammy/msvc-dev-cmd@v1
28-
with:
29-
arch: x64
30-
31-
- name: Install dependencies
32-
shell: pwsh
33-
run: |
34-
choco install cmake -y
35-
choco install ninja -y
36-
choco install llvm -y
37-
38-
- name: Configure CMake
39-
shell: pwsh
40-
run: cmake -S . -B build -G "Ninja" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
41-
42-
- name: Run clang-tidy
43-
shell: pwsh
44-
run: |
45-
clang-tidy --version
46-
$files = Get-ChildItem -Recurse -Path source -Include *.cpp,*.cc,*.cxx -File
47-
48-
# These source/.* files would be checked using .clang-tidy maintained at projectroot
49-
foreach ($file in $files) {
50-
Write-Host "Running clang-tidy on source $($file.FullName)"
51-
clang-tidy -p build "$($file.FullName)" --warnings-as-errors=*
52-
}
53-
54-
- name: Build
55-
shell: pwsh
56-
run: cmake --build build
57-
58-
- name: Run tests
59-
shell: pwsh
60-
run: ctest --test-dir build --output-on-failure
61-
62-
# --- Job 2: Create Tag and Release ---
16+
# --- Job 1: Create Tag and Release ---
6317
create-tag-and-release:
64-
# This job MUST wait for the 'lint-build-test' job to succeed
65-
needs: lint-build-test
66-
18+
6719
# This job only runs if:
6820
# 1. The PR was actually merged (implicit from 'needs', but good to be explicit).
6921
# 2. The PR was from a branch named exactly 'release'.

.github/workflows/datastructures-algorithms-validate.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@ name: datastructures-algorithms-validate
44
on:
55
pull_request:
66
types: [opened, synchronize]
7-
branches: [release]
7+
branches:
8+
- 'release'
9+
- 'main'
810

911
jobs:
1012
# --- Job 1: Lint, Build, and Test ---
1113
lint-build-test:
1214

13-
# This job will ONLY run if the PR's source branch starts with 'feature-'
14-
if: startsWith(github.event.pull_request.head.ref, 'feature-')
15+
# This job will ONLY run if:
16+
# 1. (Source is 'feature-*' AND Target is 'release')
17+
# OR
18+
# 2. (Source is 'release' AND Target is 'main')
19+
if: (startsWith(github.event.pull_request.head.ref, 'feature-') && github.event.pull_request.base.ref == 'release') || (github.event.pull_request.head.ref == 'release' && github.event.pull_request.base.ref == 'main')
1520
runs-on: windows-latest
1621

1722
steps:

0 commit comments

Comments
 (0)