Update github action and modify container to build plugins #57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: MetaCG Builds | |
| on: | |
| push: | |
| paths-ignore: | |
| - 'README.md' | |
| - 'LICENSE.txt' | |
| - 'CONTRIBUTING.md' | |
| - 'CITATION.cff' | |
| - 'AUTHORS' | |
| - 'formatSrc.sh' | |
| - '.gitlab-ci.yml' | |
| - '.gitignore' | |
| - '.ci-defaults-template.yml' | |
| - 'cgcollector/README.md' | |
| - 'cgcollector/formatAllSrc.sh' | |
| - 'cgcollector/.gitignore' | |
| - 'graph/README.md' | |
| - 'pgis/README.md' | |
| - 'tools/README.md' | |
| - 'pymetacg/README.md' | |
| pull_request: | |
| paths-ignore: | |
| - 'README.md' | |
| - 'LICENSE.txt' | |
| - 'CONTRIBUTING.md' | |
| - 'CITATION.cff' | |
| - 'AUTHORS' | |
| - 'formatSrc.sh' | |
| - '.gitlab-ci.yml' | |
| - '.gitignore' | |
| - '.ci-defaults-template.yml' | |
| - 'cgcollector/README.md' | |
| - 'cgcollector/formatAllSrc.sh' | |
| - 'cgcollector/.gitignore' | |
| - 'graph/README.md' | |
| - 'pgis/README.md' | |
| - 'tools/README.md' | |
| - 'pymetacg/README.md' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: cmake | |
| run: cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -B build -S . | |
| - name: build | |
| run: cmake --build build --parallel | |
| - name: install | |
| run: | | |
| cmake --install build --prefix install | |
| stat install/lib/libmetacg.so | |
| stat install/include/metadata/CustomMD.h | |
| stat install/lib/cmake/metacg/metacgConfig.cmake | |
| - name: install-test | |
| run: | | |
| CMAKE_PREFIX_PATH=install/lib/cmake/metacg cmake -S graph/test/install -B build-install-test | |
| cmake --build build-install-test | |
| - name: metacg-config-test | |
| run: | | |
| MCG_CFG=install/bin/metacg-config | |
| stat $MCG_CFG | |
| [[ "$($MCG_CFG --prefix)" == "$(cd install; pwd)" ]] || exit 1 | |
| [[ "$($MCG_CFG --revision)" == "$(git rev-parse HEAD)" ]] || exit 1 | |
| # TODO: Complete the llvm-20 based CI definition | |
| build-container-llvm-20: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@v6 | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: "container/full-build-llvm-20" | |
| tags: metacg-llvm-20-devel:latest | |
| load: true | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| push: false | |
| - name: Install tests | |
| uses: maus007/docker-run-action-fork@207a4e2a8ebf7e4b985656ba990b1e53715dce2a | |
| with: | |
| image: metacg-llvm-20-devel:latest | |
| run: | | |
| stat /tmp/metacg/lib/libmetacg.so | |
| stat /tmp/metacg/include/metadata/CustomMD.h | |
| stat /tmp/metacg/lib/cmake/metacg/metacgConfig.cmake | |
| stat /tmp/metacg/bin/metacg-config | |
| stat /tmp/metacg/bin/cgdiff | |
| stat /tmp/metacg/bin/cgquery | |
| stat /tmp/metacg/bin/cgformat | |
| stat /tmp/metacg/bin/cgconvert | |
| stat /tmp/metacg/bin/cgtodot | |
| - name: Check for canonical test graph format | |
| uses: maus007/docker-run-action-fork@207a4e2a8ebf7e4b985656ba990b1e53715dce2a | |
| with: | |
| image: metacg-llvm-20-devel:latest | |
| run: /opt/metacg/checkTests.sh /opt/metacg/build/tools/cgformat/cgformat | |
| - name: Run cgc2 Demo Plugin tests | |
| uses: maus007/docker-run-action-fork@207a4e2a8ebf7e4b985656ba990b1e53715dce2a | |
| with: | |
| image: metacg-llvm-18-devel:latest | |
| run: | | |
| export PATH=/tmp/metacg/bin/:$PATH | |
| export LD_LIBRARY_PATH=/tmp/metacg/lib:$LD_LIBRARY_PATH | |
| export LD_LIBRARY_PATH=/opt/metacg/tools/cgcollector2/CGC2DemoPlugin/build:$LD_LIBRARY_PATH | |
| cgcollector2 --pluginPaths=libCGC2DemoPlugin.so --metacg-format-version=4 /dev/null 2>&1 | grep -q "Successfully loaded Plugin: CGC2 Demo Plugin" | |
| - name: Run CaGe Demo Plugin tests | |
| uses: maus007/docker-run-action-fork@207a4e2a8ebf7e4b985656ba990b1e53715dce2a | |
| with: | |
| image: metacg-llvm-18-devel:latest | |
| run: | | |
| export PATH=/tmp/metacg/bin/:$PATH | |
| export LD_LIBRARY_PATH=/tmp/metacg/lib:$LD_LIBRARY_PATH | |
| export LD_LIBRARY_PATH=/opt/metacg/tools/cage/CaGeDemoPlugin/build:$LD_LIBRARY_PATH | |
| opt --load-pass-plugin=cage-plugin.so --plugin-paths=libCaGeDemoPlugin.so -S --cage-verbose --passes="CaGe" /dev/null | grep -q "Successfully loaded Plugin: Cage Demo Plugin" | |
| build-container-llvm-18: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@v4 | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: "container/full-build-llvm-18" | |
| tags: metacg-llvm-18-devel:latest | |
| load: true | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| push: false | |
| - name: Install tests | |
| uses: maus007/docker-run-action-fork@207a4e2a8ebf7e4b985656ba990b1e53715dce2a | |
| with: | |
| image: metacg-llvm-18-devel:latest | |
| run: | | |
| stat /tmp/metacg/lib/libmetacg.so | |
| stat /tmp/metacg/include/metadata/CustomMD.h | |
| stat /tmp/metacg/lib/cmake/metacg/metacgConfig.cmake | |
| stat /tmp/metacg/bin/metacg-config | |
| stat /tmp/metacg/bin/cgdiff | |
| stat /tmp/metacg/bin/cgquery | |
| stat /tmp/metacg/bin/cgformat | |
| stat /tmp/metacg/bin/cgconvert | |
| stat /tmp/metacg/bin/cgtodot | |
| - name: Check for canonical test graph format | |
| uses: maus007/docker-run-action-fork@207a4e2a8ebf7e4b985656ba990b1e53715dce2a | |
| with: | |
| image: metacg-llvm-18-devel:latest | |
| run: /opt/metacg/checkTests.sh /opt/metacg/build/tools/cgformat/cgformat | |
| - name: Run MCG library tests | |
| uses: maus007/docker-run-action-fork@207a4e2a8ebf7e4b985656ba990b1e53715dce2a | |
| with: | |
| image: metacg-llvm-18-devel:latest | |
| run: /opt/metacg/build/graph/test/unit/libtests | |
| - name: Run PGIS library tests | |
| uses: maus007/docker-run-action-fork@207a4e2a8ebf7e4b985656ba990b1e53715dce2a | |
| with: | |
| image: metacg-llvm-18-devel:latest | |
| run: /opt/metacg/build/pgis/test/unit/pgistests | |
| - name: Run target collector tests | |
| uses: maus007/docker-run-action-fork@207a4e2a8ebf7e4b985656ba990b1e53715dce2a | |
| with: | |
| image: metacg-llvm-18-devel:latest | |
| run: | | |
| cd /opt/metacg/graph/test/integration/TargetCollector | |
| ./TestRunner.sh | |
| - name: Run call graph merge tests | |
| uses: maus007/docker-run-action-fork@207a4e2a8ebf7e4b985656ba990b1e53715dce2a | |
| with: | |
| image: metacg-llvm-18-devel:latest | |
| run: | | |
| cd /opt/metacg/graph/test/integration/CallgraphMerge | |
| ./MergeTestRunner.sh | |
| - name: Run cgcollector tests | |
| uses: maus007/docker-run-action-fork@207a4e2a8ebf7e4b985656ba990b1e53715dce2a | |
| with: | |
| image: metacg-llvm-18-devel:latest | |
| run: | | |
| cd /opt/metacg/cgcollector/test | |
| bash run_format_one_test.sh | |
| bash run_format_two_test.sh | |
| - name: Run cgcollector2 tests | |
| uses: maus007/docker-run-action-fork@207a4e2a8ebf7e4b985656ba990b1e53715dce2a | |
| with: | |
| image: metacg-llvm-18-devel:latest | |
| run: | | |
| cd /opt/metacg/tools/cgcollector2/test | |
| bash testBase.sh | |
| - name: Run CaGe tests | |
| uses: maus007/docker-run-action-fork@207a4e2a8ebf7e4b985656ba990b1e53715dce2a | |
| with: | |
| image: metacg-llvm-18-devel:latest | |
| run: | | |
| cd /opt/metacg/build/tools/cage/test | |
| ./runCaGeTests.sh | |
| - name: Run cgvalidate tests | |
| uses: maus007/docker-run-action-fork@207a4e2a8ebf7e4b985656ba990b1e53715dce2a | |
| with: | |
| image: metacg-llvm-18-devel:latest | |
| run: | | |
| cd /opt/metacg/cgcollector/test/integration | |
| ./runner.sh build | |
| - name: Run cgformat tests | |
| uses: maus007/docker-run-action-fork@207a4e2a8ebf7e4b985656ba990b1e53715dce2a | |
| with: | |
| image: metacg-llvm-18-devel:latest | |
| run: | | |
| cd /opt/metacg/build/tools/cgformat/test | |
| ./run_cgformat_tests.sh | |
| - name: Run pymetacg tests | |
| uses: maus007/docker-run-action-fork@207a4e2a8ebf7e4b985656ba990b1e53715dce2a | |
| with: | |
| image: metacg-llvm-18-devel:latest | |
| run: | | |
| cd /opt/metacg/build/pymetacg/tests | |
| ctest . --verbose | |
| - name: Run cpatch pass-tests (lit) | |
| uses: maus007/docker-run-action-fork@207a4e2a8ebf7e4b985656ba990b1e53715dce2a | |
| with: | |
| image: metacg-llvm-18-devel:latest | |
| run: | | |
| cd /opt/metacg/ | |
| cmake --build build --target pass-tests | |
| cmake --build build --targetake pass-tests-lto | |
| cmake --build build --target pass-tests-optimized | |
| cmake --build build --target pass-tests-optimized-lto | |
| - name: Run cgpatch integration tests | |
| uses: maus007/docker-run-action-fork@207a4e2a8ebf7e4b985656ba990b1e53715dce2a | |
| with: | |
| image: metacg-llvm-18-devel:latest | |
| run: | | |
| export OMPI_ALLOW_RUN_AS_ROOT=1 | |
| export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 | |
| cd /opt/metacg/build/tools/cgpatch/test/integration/ | |
| ./CGPIntegrationRunner.sh -d | |
| - name: Run cgdiff integration tests | |
| uses: maus007/docker-run-action-fork@207a4e2a8ebf7e4b985656ba990b1e53715dce2a | |
| with: | |
| image: metacg-llvm-18-devel:latest | |
| run: | | |
| cd /opt/metacg/tools/cgdiff/test/integration/ | |
| ./run_tests.sh -b build | |
| - name: Run cgdiff unit tests | |
| uses: maus007/docker-run-action-fork@207a4e2a8ebf7e4b985656ba990b1e53715dce2a | |
| with: | |
| image: metacg-llvm-18-devel:latest | |
| run: /opt/metacg/build/tools/cgdiff/test/unit/cgdifftests | |
| - name: Run cgtodot tests | |
| uses: maus007/docker-run-action-fork@207a4e2a8ebf7e4b985656ba990b1e53715dce2a | |
| with: | |
| image: metacg-llvm-18-devel:latest | |
| run: | | |
| cd /opt/metacg/build/tools/cgtodot/ | |
| ctest . --verbose | |
| - name: Run cgc2 Demo Plugin tests | |
| uses: maus007/docker-run-action-fork@207a4e2a8ebf7e4b985656ba990b1e53715dce2a | |
| with: | |
| image: metacg-llvm-18-devel:latest | |
| run: | | |
| export PATH=/tmp/metacg/bin/:$PATH | |
| export LD_LIBRARY_PATH=/tmp/metacg/lib:$LD_LIBRARY_PATH | |
| export LD_LIBRARY_PATH=/opt/metacg/tools/cgcollector2/CGC2DemoPlugin/build:$LD_LIBRARY_PATH | |
| cgcollector2 --pluginPaths=libCGC2DemoPlugin.so --metacg-format-version=4 /dev/null 2>&1 | grep -q "Successfully loaded Plugin: CGC2 Demo Plugin" | |
| - name: Run CaGe Demo Plugin tests | |
| uses: maus007/docker-run-action-fork@207a4e2a8ebf7e4b985656ba990b1e53715dce2a | |
| with: | |
| image: metacg-llvm-18-devel:latest | |
| run: | | |
| export PATH=/tmp/metacg/bin/:$PATH | |
| export LD_LIBRARY_PATH=/tmp/metacg/lib:$LD_LIBRARY_PATH | |
| export LD_LIBRARY_PATH=/opt/metacg/tools/cage/CaGeDemoPlugin/build:$LD_LIBRARY_PATH | |
| opt --load-pass-plugin=cage-plugin.so --plugin-paths=libCaGeDemoPlugin.so -S --cage-verbose --passes="CaGe" /dev/null | grep -q "Successfully loaded Plugin: Cage Demo Plugin" |