Skip to content

Commit

Permalink
fixup! ci: Test CMake edge cases
Browse files Browse the repository at this point in the history
Add CI test for `obj/build.h` generation.
  • Loading branch information
hebasto committed Nov 22, 2023
1 parent a3f55c4 commit 270dee9
Showing 1 changed file with 59 additions and 1 deletion.
60 changes: 59 additions & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,67 @@ concurrency:
cancel-in-progress: true

jobs:
build-info:
name: 'Test obj/build.h generation'
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- run: cp cmake/script/GenerateBuildInfo.cmake ${{ runner.temp }}

- name: Test at HEAD
run: |
rm -rf src/obj build/src/obj
mkdir -p src/obj build/src/obj
./share/genbuild.sh ${PWD}/src/obj/build.h ${PWD}
cmake -DBUILD_INFO_HEADER_PATH=${PWD}/build/src/obj/build.h -DSOURCE_DIR=${PWD} -P ${{ runner.temp }}/GenerateBuildInfo.cmake
diff -u src/obj/build.h build/src/obj/build.h
- name: Test at tag
run: |
rm -rf src/obj build/src/obj
mkdir -p src/obj build/src/obj
git checkout v25.1
./share/genbuild.sh ${PWD}/src/obj/build.h ${PWD}
cmake -DBUILD_INFO_HEADER_PATH=${PWD}/build/src/obj/build.h -DSOURCE_DIR=${PWD} -P ${{ runner.temp }}/GenerateBuildInfo.cmake
diff -u src/obj/build.h build/src/obj/build.h
- name: Test dirty tree
run: |
rm -rf src/obj build/src/obj
mkdir -p src/obj build/src/obj
echo "test" >> README.md
./share/genbuild.sh ${PWD}/src/obj/build.h ${PWD}
cmake -DBUILD_INFO_HEADER_PATH=${PWD}/build/src/obj/build.h -DSOURCE_DIR=${PWD} -P ${{ runner.temp }}/GenerateBuildInfo.cmake
diff -u src/obj/build.h build/src/obj/build.h
- name: Test BITCOIN_GENBUILD_NO_GIT
env:
BITCOIN_GENBUILD_NO_GIT: '1'
run: |
rm -rf src/obj build/src/obj
mkdir -p src/obj build/src/obj
./share/genbuild.sh ${PWD}/src/obj/build.h ${PWD}
cmake -DBUILD_INFO_HEADER_PATH=${PWD}/build/src/obj/build.h -DSOURCE_DIR=${PWD} -P ${{ runner.temp }}/GenerateBuildInfo.cmake
diff -u src/obj/build.h build/src/obj/build.h
- name: Test the test
run: |
rm -rf src/obj build/src/obj
mkdir -p src/obj build/src/obj
./share/genbuild.sh ${PWD}/src/obj/build.h ${PWD}
cmake -DBUILD_INFO_HEADER_PATH=${PWD}/build/src/obj/build.h -DSOURCE_DIR=${PWD} -P ${{ runner.temp }}/GenerateBuildInfo.cmake
echo "test" >> src/obj/build.h
diff -u src/obj/build.h build/src/obj/build.h
cross-build:
name: ${{ matrix.host.name }}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

strategy:
fail-fast: false
Expand Down

0 comments on commit 270dee9

Please sign in to comment.