CI: adopt singleheader CI to updated filenames #188
Workflow file for this run
This file contains 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: CMake | |
on: | |
push: | |
branches: [ main, singleheader_merge ] # singleheader_merge branch used for modifications to the CI | |
jobs: | |
build: | |
name: "Create single-header release" | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 100 | |
- name: Cache | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-fetchContent-cache | |
with: | |
path: ${{runner.workspace}}/build/_deps | |
key: ${{ runner.os }}-gcc-Release-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('cmake/Dependencies.cmake') }} | |
- name: Install gcc-12 | |
run: | | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa # provides newer gcc 12.2.0 instead of 12.1.0 | |
sudo apt-get install -y gcc-12 g++-12 | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 110 --slave /usr/bin/g++ g++ /usr/bin/g++-12 --slave /usr/bin/gcov gcov /usr/bin/gcov-12 | |
- name: Configure CMake to fetch UT dependency | |
shell: bash | |
run: cmake -S . -B ./build -DCMAKE_BUILD_TYPE=Release | |
- name: create single-header | |
shell: bash | |
run: | | |
wget https://raw.githubusercontent.com/edlund/amalgamate/c91f07eea1133aa184f652b8f1398eaf03586208/amalgamate.py | |
mkdir -p singleheader | |
python3 amalgamate.py -c devtools/singleheader-config-graph.json -s . -v yes | |
python3 amalgamate.py -c devtools/singleheader-config-bench.json -s bench/ -v yes | |
- name: upload to branch # keeping history of single-header branch | |
run: | | |
git config --global user.name "single header generator" | |
git config --global user.email "[email protected]" | |
git add singleheader | |
git fetch --depth=1 origin single-header:single-header | |
git reset --soft origin/single-header | |
git rev-parse HEAD@{1} > .git/MERGE_HEAD | |
git commit -m "single-header of $(git rev-parse --short HEAD@{1})" | |
git push origin HEAD:single-header |