Skip to content

Commit 0149934

Browse files
committed
[CI] Add demo-maxr.yml to test other project and factorize CI code
1 parent c71a6ad commit 0149934

4 files changed

Lines changed: 145 additions & 61 deletions

File tree

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: 'Build ccccc'
2+
description: 'Build ccccc'
3+
inputs:
4+
llvm-version:
5+
description: 'Version of llvm to use'
6+
required: false
7+
default: '19'
8+
9+
runs:
10+
using: "composite"
11+
outputs:
12+
llvm-root: ${{ steps.LLVM.outputs.LLVM_ROOT }}
13+
steps:
14+
15+
- uses: Jarod42/install-premake5@v7
16+
17+
# To Create compile_commands.json
18+
- name: checkout premake-export-compile-commands
19+
uses: actions/checkout@v6
20+
with:
21+
repository: Jarod42/premake-export-compile-commands
22+
path: premake-export-compile-commands
23+
ref: Improvements
24+
25+
- name: aptget llvm for Linux
26+
if: runner.os == 'Linux'
27+
id: LLVM
28+
run: |
29+
sudo apt-get update
30+
sudo apt-get install clang-${{ inputs.llvm-version }} libclang-${{ inputs.llvm-version }}-dev llvm-${{ inputs.llvm-version }}-dev llvm-${{ inputs.llvm-version }}-runtime llvm-${{ inputs.llvm-version }}
31+
echo "LLVM_ROOT=/usr/lib/llvm-${{ inputs.llvm-version }}" >> $GITHUB_OUTPUT
32+
shell: bash
33+
34+
-name: debug LLVM
35+
echo "LLVM_ROOT:" $LLVM_ROOT
36+
echo "================ ls $LLVM_ROOT/lib" && ls $LLVM_ROOT/lib
37+
echo "================ ls $LLVM_ROOT/bin" && ls $LLVM_ROOT/bin
38+
echo "================ llvm-config --cppflags" && $LLVM_ROOT/bin/llvm-config --cppflags
39+
echo "================ llvm-config --ldflags" && $LLVM_ROOT/bin/llvm-config --system-libs --ldflags --libs all support
40+
env:
41+
LLVM_ROOT: ${{steps.LLVM.outputs.LLVM_ROOT}}
42+
shell: bash
43+
44+
# - name: Build standalone mstch
45+
# run: |
46+
# mkdir 3rd/mstch/build
47+
# cd 3rd/mstch/build
48+
# cmake .. && make
49+
# sudo make install
50+
51+
- name: build ccccc
52+
run: |
53+
cd ${{ inputs.path }}
54+
premake5 --llvm-root="${{steps.LLVM.outputs.LLVM_ROOT}}" gmake
55+
cd project/gmake && make config=release verbose=1
56+
cp ../../bin/gmake/Release/ccccc ../..
57+
shell: bash
58+
59+
- name: aptget llvm
60+
if: runner.os == 'macOS'
61+
run: |
62+
echo NOT SUPPORTED YET && exit -1
63+
shell: bash
64+
65+
- name: Build premake5
66+
if: runner.os == 'Windows'
67+
run: |
68+
echo NOT SUPPORTED YET && exit -1
69+
shell: powershell

.github/workflows/demo-codelite.yml

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,31 +30,15 @@ jobs:
3030

3131
steps:
3232

33-
# ccccc build
34-
- uses: Jarod42/install-premake5@v7
35-
36-
- name: aptget llvm
37-
id: LLVM
38-
run: |
39-
sudo apt-get install clang-${{ inputs.llvm-version }} libclang-${{ inputs.llvm-version }}-dev llvm-${{ inputs.llvm-version }}-dev llvm-${{ inputs.llvm-version }}-runtime llvm-${{ inputs.llvm-version }}
40-
echo "LLVM_ROOT=/usr/lib/llvm-${{ inputs.llvm-version }}" >> $GITHUB_OUTPUT
41-
4233
- name: checkout ccccc
4334
uses: actions/checkout@v6
4435
with:
4536
submodules: recursive
46-
repository: Jarod42/ccccc
47-
path: ccccc
4837

49-
- name: premake gmake
50-
run: |
51-
cd ccccc
52-
premake5 --llvm-root="${{steps.LLVM.outputs.LLVM_ROOT}}" gmake
53-
54-
- name: make config=release
55-
run: |
56-
cd ccccc/project/gmake
57-
make config=release verbose=1
38+
- name: Install premake & build ccccc
39+
uses: ./.github/actions/build-ccccc
40+
with:
41+
llvm-version: ${{ inputs.llvm-version }}
5842

5943
# WxWidgets
6044
- name: install dependencies for wxWidgets
@@ -101,7 +85,7 @@ jobs:
10185
# ccccc runs
10286
- name: run ccccc on Codelite
10387
run: |
104-
ccccc/bin/gmake/Release/ccccc --exclude-directory=codelite/build-release --exclude-directory=codelite/submodules --exclude-directory=codelite/sdk --template-file=ccccc/template/ccccc_html/template.tpl --source-root-url=https://github.com/eranif/codelite/blob/master codelite/build-release/compile_commands.json > codelite-index.html
88+
./ccccc --exclude-directory=codelite/build-release --exclude-directory=codelite/submodules --exclude-directory=codelite/sdk --template-file=template/ccccc_html/template.tpl --source-root-url=https://github.com/eranif/codelite/blob/master codelite/build-release/compile_commands.json > codelite-index.html
10589
10690
- name: Upload index.html
10791
uses: actions/upload-artifact@v6

.github/workflows/demo-maxr.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: demo-maxr
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
llvm-version:
7+
default: '19'
8+
type: string
9+
workflow_dispatch:
10+
inputs:
11+
llvm-version:
12+
default: '19'
13+
type: string
14+
15+
jobs:
16+
linux:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
21+
- name: apt-get update
22+
run: sudo apt-get update
23+
24+
- name: checkout ccccc
25+
uses: actions/checkout@v6
26+
with:
27+
submodules: recursive
28+
29+
- name: Install premake & build ccccc
30+
uses: ./.github/actions/build-ccccc
31+
with:
32+
llvm-version: ${{ inputs.llvm-version }}
33+
34+
# MaxR
35+
- name: Checkout
36+
uses: actions/checkout@v6
37+
with:
38+
submodules: recursive
39+
fetch-depth: 0
40+
fetch-tags: true
41+
path: maxr
42+
43+
- name: install dependencies
44+
run: |
45+
sudo apt-get install libsdl2-dev libsdl2-mixer-dev libsdl2-net-dev libogg-dev libvorbis-dev libvorbisenc2 libvorbisidec-dev
46+
47+
- name: generate compile_commands.json
48+
run: |
49+
echo "require 'premake-export-compile-commands/export-compile-commands'" >> premake-system.lua
50+
premake5 export-compile-commands --to=project/export-compile-commands
51+
52+
# ccccc runs
53+
- name: run ccccc on Maxr
54+
run: |
55+
./ccccc --exclude-directory=maxr/submodules --template-file=template/ccccc_html/template.tpl --source-root-url=https://github.com/maxr/maxr/blob/master project/export-compile-commands/release/compile_commands.json > maxr-index.html
56+
57+
- name: Upload index.html
58+
uses: actions/upload-artifact@v6
59+
with:
60+
name: maxr_ccccc
61+
path: |
62+
maxr-index.html

.github/workflows/ubuntu.yml

Lines changed: 9 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -12,68 +12,37 @@ jobs:
1212
build:
1313
strategy:
1414
matrix:
15-
version: [14, 19]
15+
llvm-version: [14, 19]
1616
runs-on: ubuntu-latest
1717

1818
steps:
1919

20-
- uses: Jarod42/install-premake5@v7
20+
- uses: actions/checkout@v6
21+
with:
22+
submodules: recursive
2123

2224
- name: gcc version
2325
run: |
2426
g++ --version
2527
26-
- name: aptget llvm
28+
- name: Install premake & build ccccc
29+
uses: ./.github/actions/build-ccccc
2730
id: LLVM
28-
run: |
29-
sudo apt-get install clang-${{matrix.version}} libclang-${{matrix.version}}-dev llvm-${{matrix.version}}-dev llvm-${{matrix.version}}-runtime llvm-${{matrix.version}}
30-
echo "LLVM_ROOT=/usr/lib/llvm-${{matrix.version}}" >> $GITHUB_OUTPUT
31-
32-
- name: DEBUG llvm
33-
run: |
34-
echo "LLVM_ROOT:" $LLVM_ROOT
35-
echo "================ ls $LLVM_ROOT/lib" && ls $LLVM_ROOT/lib
36-
echo "================ ls $LLVM_ROOT/bin" && ls $LLVM_ROOT/bin
37-
echo "================ llvm-config --cppflags" && $LLVM_ROOT/bin/llvm-config --cppflags
38-
echo "================ llvm-config --ldflags" && $LLVM_ROOT/bin/llvm-config --system-libs --ldflags --libs all support
39-
env:
40-
LLVM_ROOT: ${{steps.LLVM.outputs.LLVM_ROOT}}
41-
42-
- uses: actions/checkout@v6
4331
with:
44-
submodules: recursive
45-
46-
# - name: Build standalone mstch
47-
# run: |
48-
# mkdir 3rd/mstch/build
49-
# cd 3rd/mstch/build
50-
# cmake .. && make
51-
# sudo make install
32+
llvm-version: ${{ matrix.llvm-version }}
5233

53-
- name: premake gmake
54-
run: premake5 --llvm-root="${{steps.LLVM.outputs.LLVM_ROOT}}" gmake
55-
56-
- name: make config=release
34+
- name: test ccccc
5735
run: |
58-
cd project/gmake && make config=release verbose=1
5936
cd ../../bin/gmake/Release
6037
./ccccc_test
6138
./ccccc --version
6239
./ccccc --help
6340
64-
# Create compile_commands.json
65-
- name: checkout premake-export-compile-commands
66-
uses: actions/checkout@v6
67-
with:
68-
repository: Jarod42/premake-export-compile-commands
69-
path: premake-export-compile-commands
70-
ref: Improvements
71-
7241
- name: run ccccc on itself
7342
run: |
7443
echo "require 'premake-export-compile-commands/export-compile-commands'" >> premake-system.lua
7544
premake5 --llvm-root="${{steps.LLVM.outputs.LLVM_ROOT}}" --expand-llvm-config export-compile-commands
76-
./bin/gmake/Release/ccccc --template-file=template/ccccc_html/template.tpl --source-root-url=https://github.com/Jarod42/ccccc/blob/master --exclude-directory=3rd project/export-compile-commands/release/compile_commands.json > index.html
45+
./ccccc --template-file=template/ccccc_html/template.tpl --source-root-url=https://github.com/Jarod42/ccccc/blob/master --exclude-directory=3rd project/export-compile-commands/release/compile_commands.json > index.html
7746
7847
- name: Upload index.html
7948
uses: actions/upload-artifact@v6

0 commit comments

Comments
 (0)