Skip to content

Commit 0cd9c4d

Browse files
committed
Add per language test workflows
1 parent 733e883 commit 0cd9c4d

5 files changed

Lines changed: 550 additions & 0 deletions

File tree

.github/workflows/test-c.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Test — C
2+
3+
# Exercises the whole regression pipeline for C:
4+
# 1. Build srcml from source on ubuntu-latest via the ci-ubuntu cmake workflow preset.
5+
# 2. Collect the .deb produced by CPack.
6+
# 3. Run the reusable regression-test.yml against the current C baselines.
7+
#
8+
# Requires: a baseline release must already be published for each project
9+
# (run baseline-c.yml first).
10+
11+
on:
12+
workflow_dispatch:
13+
inputs:
14+
srcml_ref:
15+
description: "srcML git ref to build (tag, branch, or SHA)"
16+
required: false
17+
default: "v1.1.0"
18+
fail_on_regression:
19+
description: "Fail the workflow if the regression test reports failures"
20+
required: false
21+
type: boolean
22+
default: true
23+
24+
permissions:
25+
contents: read
26+
actions: read
27+
28+
concurrency:
29+
group: test-c-${{ github.ref }}-${{ inputs.srcml_ref }}
30+
cancel-in-progress: true
31+
32+
jobs:
33+
build-srcml:
34+
runs-on: ubuntu-latest
35+
timeout-minutes: 60
36+
outputs:
37+
artifact_name: ${{ steps.upload.outputs.artifact-name }}
38+
steps:
39+
- name: Checkout srcML source
40+
uses: actions/checkout@v4
41+
with:
42+
repository: srcML/srcML
43+
ref: ${{ inputs.srcml_ref }}
44+
path: srcML
45+
46+
- name: Install build dependencies
47+
run: |
48+
sudo apt-get update
49+
sudo apt-get install -y \
50+
antlr libantlr-dev libantlr-java \
51+
libarchive-dev libcurl4-openssl-dev \
52+
libxml2-dev libxml2-utils libxslt1-dev \
53+
cmake ninja-build g++ dpkg-dev
54+
55+
- name: Run cmake ci-ubuntu workflow preset
56+
id: cmake_workflow
57+
working-directory: srcML
58+
continue-on-error: true
59+
run: |
60+
set -euxo pipefail
61+
cmake --workflow --preset ci-ubuntu
62+
63+
- name: Locate .deb artifacts
64+
id: locate
65+
run: |
66+
set -euo pipefail
67+
# ci-ubuntu uses ci-sibling-build -> build dir is srcML-build/ alongside srcML/
68+
BUILD_DIR="srcML-build"
69+
DIST_DIR="${BUILD_DIR}/dist"
70+
if [ ! -d "$DIST_DIR" ]; then
71+
echo "::error::CPack output directory not found: $DIST_DIR"
72+
echo "cmake workflow outcome: ${{ steps.cmake_workflow.outcome }}"
73+
ls -la "$BUILD_DIR" || true
74+
exit 1
75+
fi
76+
ls -la "$DIST_DIR"
77+
78+
mkdir -p installer
79+
# srcml_*.deb is required; srcml-dev_*.deb is optional
80+
if ! compgen -G "${DIST_DIR}/srcml_*.deb" > /dev/null; then
81+
echo "::error::no srcml_*.deb produced by CPack"
82+
exit 1
83+
fi
84+
cp "${DIST_DIR}"/srcml_*.deb installer/
85+
cp "${DIST_DIR}"/srcml-dev_*.deb installer/ 2>/dev/null || true
86+
ls -la installer/
87+
echo "deb_count=$(ls installer/*.deb | wc -l)" >> "$GITHUB_OUTPUT"
88+
89+
- name: Upload installer artifact
90+
id: upload
91+
uses: actions/upload-artifact@v4
92+
with:
93+
name: srcml-installer-from-source
94+
path: installer/
95+
if-no-files-found: error
96+
97+
regression:
98+
needs: build-srcml
99+
strategy:
100+
fail-fast: false
101+
matrix:
102+
target:
103+
- {language: c, project: linux}
104+
uses: ./.github/workflows/regression-test.yml
105+
with:
106+
srcml-installer-artifact-name: srcml-installer-from-source
107+
language: ${{ matrix.target.language }}
108+
project: ${{ matrix.target.project }}
109+
fail-on-regression: ${{ inputs.fail_on_regression }}
110+
artifact-name: full-pipeline-${{ matrix.target.language }}-${{ matrix.target.project }}

.github/workflows/test-cpp.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Test — C++
2+
3+
# Exercises the whole regression pipeline for C++:
4+
# 1. Build srcml from source on ubuntu-latest via the ci-ubuntu cmake workflow preset.
5+
# 2. Collect the .deb produced by CPack.
6+
# 3. Run the reusable regression-test.yml against the current C++ baselines.
7+
#
8+
# Requires: a baseline release must already be published for each project
9+
# (run baseline-cpp.yml first).
10+
11+
on:
12+
workflow_dispatch:
13+
inputs:
14+
srcml_ref:
15+
description: "srcML git ref to build (tag, branch, or SHA)"
16+
required: false
17+
default: "v1.1.0"
18+
fail_on_regression:
19+
description: "Fail the workflow if the regression test reports failures"
20+
required: false
21+
type: boolean
22+
default: true
23+
24+
permissions:
25+
contents: read
26+
actions: read
27+
28+
concurrency:
29+
group: test-cpp-${{ github.ref }}-${{ inputs.srcml_ref }}
30+
cancel-in-progress: true
31+
32+
jobs:
33+
build-srcml:
34+
runs-on: ubuntu-latest
35+
timeout-minutes: 60
36+
outputs:
37+
artifact_name: ${{ steps.upload.outputs.artifact-name }}
38+
steps:
39+
- name: Checkout srcML source
40+
uses: actions/checkout@v4
41+
with:
42+
repository: srcML/srcML
43+
ref: ${{ inputs.srcml_ref }}
44+
path: srcML
45+
46+
- name: Install build dependencies
47+
run: |
48+
sudo apt-get update
49+
sudo apt-get install -y \
50+
antlr libantlr-dev libantlr-java \
51+
libarchive-dev libcurl4-openssl-dev \
52+
libxml2-dev libxml2-utils libxslt1-dev \
53+
cmake ninja-build g++ dpkg-dev
54+
55+
- name: Run cmake ci-ubuntu workflow preset
56+
id: cmake_workflow
57+
working-directory: srcML
58+
continue-on-error: true
59+
run: |
60+
set -euxo pipefail
61+
cmake --workflow --preset ci-ubuntu
62+
63+
- name: Locate .deb artifacts
64+
id: locate
65+
run: |
66+
set -euo pipefail
67+
# ci-ubuntu uses ci-sibling-build -> build dir is srcML-build/ alongside srcML/
68+
BUILD_DIR="srcML-build"
69+
DIST_DIR="${BUILD_DIR}/dist"
70+
if [ ! -d "$DIST_DIR" ]; then
71+
echo "::error::CPack output directory not found: $DIST_DIR"
72+
echo "cmake workflow outcome: ${{ steps.cmake_workflow.outcome }}"
73+
ls -la "$BUILD_DIR" || true
74+
exit 1
75+
fi
76+
ls -la "$DIST_DIR"
77+
78+
mkdir -p installer
79+
# srcml_*.deb is required; srcml-dev_*.deb is optional
80+
if ! compgen -G "${DIST_DIR}/srcml_*.deb" > /dev/null; then
81+
echo "::error::no srcml_*.deb produced by CPack"
82+
exit 1
83+
fi
84+
cp "${DIST_DIR}"/srcml_*.deb installer/
85+
cp "${DIST_DIR}"/srcml-dev_*.deb installer/ 2>/dev/null || true
86+
ls -la installer/
87+
echo "deb_count=$(ls installer/*.deb | wc -l)" >> "$GITHUB_OUTPUT"
88+
89+
- name: Upload installer artifact
90+
id: upload
91+
uses: actions/upload-artifact@v4
92+
with:
93+
name: srcml-installer-from-source
94+
path: installer/
95+
if-no-files-found: error
96+
97+
regression:
98+
needs: build-srcml
99+
strategy:
100+
fail-fast: false
101+
matrix:
102+
target:
103+
- {language: cpp, project: llvm}
104+
uses: ./.github/workflows/regression-test.yml
105+
with:
106+
srcml-installer-artifact-name: srcml-installer-from-source
107+
language: ${{ matrix.target.language }}
108+
project: ${{ matrix.target.project }}
109+
fail-on-regression: ${{ inputs.fail_on_regression }}
110+
artifact-name: full-pipeline-${{ matrix.target.language }}-${{ matrix.target.project }}

.github/workflows/test-csharp.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Test — C#
2+
3+
# Exercises the whole regression pipeline for C#:
4+
# 1. Build srcml from source on ubuntu-latest via the ci-ubuntu cmake workflow preset.
5+
# 2. Collect the .deb produced by CPack.
6+
# 3. Run the reusable regression-test.yml against the current C# baselines.
7+
#
8+
# Requires: a baseline release must already be published for each project
9+
# (run baseline-csharp.yml first).
10+
11+
on:
12+
workflow_dispatch:
13+
inputs:
14+
srcml_ref:
15+
description: "srcML git ref to build (tag, branch, or SHA)"
16+
required: false
17+
default: "v1.1.0"
18+
fail_on_regression:
19+
description: "Fail the workflow if the regression test reports failures"
20+
required: false
21+
type: boolean
22+
default: true
23+
24+
permissions:
25+
contents: read
26+
actions: read
27+
28+
concurrency:
29+
group: test-csharp-${{ github.ref }}-${{ inputs.srcml_ref }}
30+
cancel-in-progress: true
31+
32+
jobs:
33+
build-srcml:
34+
runs-on: ubuntu-latest
35+
timeout-minutes: 60
36+
outputs:
37+
artifact_name: ${{ steps.upload.outputs.artifact-name }}
38+
steps:
39+
- name: Checkout srcML source
40+
uses: actions/checkout@v4
41+
with:
42+
repository: srcML/srcML
43+
ref: ${{ inputs.srcml_ref }}
44+
path: srcML
45+
46+
- name: Install build dependencies
47+
run: |
48+
sudo apt-get update
49+
sudo apt-get install -y \
50+
antlr libantlr-dev libantlr-java \
51+
libarchive-dev libcurl4-openssl-dev \
52+
libxml2-dev libxml2-utils libxslt1-dev \
53+
cmake ninja-build g++ dpkg-dev
54+
55+
- name: Run cmake ci-ubuntu workflow preset
56+
id: cmake_workflow
57+
working-directory: srcML
58+
continue-on-error: true
59+
run: |
60+
set -euxo pipefail
61+
cmake --workflow --preset ci-ubuntu
62+
63+
- name: Locate .deb artifacts
64+
id: locate
65+
run: |
66+
set -euo pipefail
67+
# ci-ubuntu uses ci-sibling-build -> build dir is srcML-build/ alongside srcML/
68+
BUILD_DIR="srcML-build"
69+
DIST_DIR="${BUILD_DIR}/dist"
70+
if [ ! -d "$DIST_DIR" ]; then
71+
echo "::error::CPack output directory not found: $DIST_DIR"
72+
echo "cmake workflow outcome: ${{ steps.cmake_workflow.outcome }}"
73+
ls -la "$BUILD_DIR" || true
74+
exit 1
75+
fi
76+
ls -la "$DIST_DIR"
77+
78+
mkdir -p installer
79+
# srcml_*.deb is required; srcml-dev_*.deb is optional
80+
if ! compgen -G "${DIST_DIR}/srcml_*.deb" > /dev/null; then
81+
echo "::error::no srcml_*.deb produced by CPack"
82+
exit 1
83+
fi
84+
cp "${DIST_DIR}"/srcml_*.deb installer/
85+
cp "${DIST_DIR}"/srcml-dev_*.deb installer/ 2>/dev/null || true
86+
ls -la installer/
87+
echo "deb_count=$(ls installer/*.deb | wc -l)" >> "$GITHUB_OUTPUT"
88+
89+
- name: Upload installer artifact
90+
id: upload
91+
uses: actions/upload-artifact@v4
92+
with:
93+
name: srcml-installer-from-source
94+
path: installer/
95+
if-no-files-found: error
96+
97+
regression:
98+
needs: build-srcml
99+
strategy:
100+
fail-fast: false
101+
matrix:
102+
target:
103+
- {language: csharp, project: roslyn}
104+
uses: ./.github/workflows/regression-test.yml
105+
with:
106+
srcml-installer-artifact-name: srcml-installer-from-source
107+
language: ${{ matrix.target.language }}
108+
project: ${{ matrix.target.project }}
109+
fail-on-regression: ${{ inputs.fail_on_regression }}
110+
artifact-name: full-pipeline-${{ matrix.target.language }}-${{ matrix.target.project }}

0 commit comments

Comments
 (0)