VCPKG Continuous Integration #6748
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: VCPKG Continuous Integration | |
on: | |
# Run this workflow once every 6 hours against the master branch | |
schedule: | |
- cron: "0 */6 * * *" | |
push: | |
branches: | |
- "master" | |
tags: | |
- "*" | |
pull_request: | |
jobs: | |
build_linux: | |
strategy: | |
fail-fast: false | |
matrix: | |
image: | |
- { name: "ubuntu", tag: "22.04" } | |
llvm: ["17"] | |
compiler: | |
- { CC: "clang", CXX: "clang++" } | |
- { CC: "gcc", CXX: "g++" } | |
env: | |
CC: ${{ matrix.compiler.CC }} | |
CXX: ${{ matrix.compiler.CXX }} | |
runs-on: ubuntu-22.04 | |
container: | |
image: ghcr.io/lifting-bits/cxx-common/vcpkg-builder-${{ matrix.image.name }}:${{ matrix.image.tag }} | |
volumes: | |
- /:/gha-runner | |
credentials: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- uses: ./.github/actions/prepare_git_user | |
- name: Clear space | |
shell: bash | |
run: | | |
df -h | |
rm -rf /gha-runner/usr/local/lib/android | |
rm -rf /gha-runner/usr/local/share/boost | |
df -h | |
- name: Build with build script | |
shell: bash | |
run: | | |
git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
./scripts/build.sh --llvm-version ${{ matrix.llvm }} | |
mkdir remill-rel/ | |
mv remill-build/*.deb ./remill-rel | |
mv remill-build/*.rpm ./remill-rel | |
mv remill-build/*.tar.gz ./remill-rel | |
rm -rf remill-build/_CPack_Packages | |
- name: Build with build-presets script | |
shell: bash | |
run: | | |
export CMAKE_TOOLCHAIN_FILE=$(pwd)/../lifting-bits-downloads/vcpkg_${{ matrix.image.name }}-${{ matrix.image.tag }}_llvm-${{ matrix.llvm }}_amd64/scripts/buildsystems/vcpkg.cmake | |
export INSTALL_DIR=$(pwd)/remill-preset-install | |
./scripts/build-preset.sh release | |
- name: Install Python Test Deps | |
shell: bash | |
run: | | |
pip3 install --user ./scripts/diff_tester_export_insns | |
- name: Tree size | |
shell: bash | |
run: | | |
du -hs | |
df -h | |
- name: Run tests | |
shell: bash | |
working-directory: remill-build | |
run: | | |
cmake --build . --target install -- -j "$(nproc)" | |
cmake --build . --target test_dependencies -- -j "$(nproc)" | |
env CTEST_OUTPUT_ON_FAILURE=1 cmake --build . --target test -- -j "$(nproc)" | |
- name: Tree size after | |
shell: bash | |
if: failure() | |
run: | | |
df -h | |
du -h $(pwd)/../ | sort -h | |
df -h | |
- name: Smoketests with installed executable | |
shell: bash | |
run: | | |
remill-lift-${{ matrix.llvm }} --arch amd64 --ir_out /dev/stdout --bytes c704ba01000000 | |
remill-lift-${{ matrix.llvm }} --arch aarch64 --ir_out /dev/stdout --address 0x400544 --bytes FD7BBFA90000009000601891FD030091B7FFFF97E0031F2AFD7BC1A8C0035FD6 | |
remill-lift-${{ matrix.llvm }} --arch aarch32 -ir_out /dev/stderr --bytes 0cd04de208008de504108de500208de508309de504009de500109de5903122e0c20fa0e110109fe5001091e5002081e5040081e50cd08de21eff2fe14000000000000000 | |
- name: Locate the packages | |
id: package_names | |
shell: bash | |
working-directory: remill-rel | |
run: | | |
echo ::set-output name=DEB_PACKAGE_PATH::remill-rel/$(ls *.deb) | |
echo ::set-output name=RPM_PACKAGE_PATH::remill-rel/$(ls *.rpm) | |
echo ::set-output name=TGZ_PACKAGE_PATH::remill-rel/$(ls *.tar.gz) | |
- name: Store the DEB package | |
uses: actions/upload-artifact@v1 | |
with: | |
name: ${{ matrix.image.name }}-${{ matrix.image.tag }}_llvm${{ matrix.llvm }}_deb_package | |
path: ${{ steps.package_names.outputs.DEB_PACKAGE_PATH }} | |
- name: Store the RPM package | |
uses: actions/upload-artifact@v1 | |
with: | |
name: ${{ matrix.image.name }}-${{ matrix.image.tag }}_llvm${{ matrix.llvm }}_rpm_package | |
path: ${{ steps.package_names.outputs.RPM_PACKAGE_PATH }} | |
- name: Store the TGZ package | |
uses: actions/upload-artifact@v1 | |
with: | |
name: ${{ matrix.image.name }}-${{ matrix.image.tag }}_llvm${{ matrix.llvm }}_tgz_package | |
path: ${{ steps.package_names.outputs.TGZ_PACKAGE_PATH }} | |
build_mac: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["macos-13"] | |
llvm: ["17"] | |
runs-on: macos-13 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- uses: ./.github/actions/prepare_git_user | |
- name: Get Poetry | |
shell: bash | |
run: | | |
python3 -m pip install poetry | |
- name: Install Python Test Deps | |
shell: bash | |
run: | | |
python3 -m pip install --user ./scripts/diff_tester_export_insns | |
- name: Build with build script | |
shell: bash | |
run: | | |
git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
./scripts/build.sh --llvm-version ${{ matrix.llvm }} | |
- name: Build with build-presets script | |
shell: bash | |
run: | | |
brew install ninja | |
export CMAKE_TOOLCHAIN_FILE=$(pwd)/../lifting-bits-downloads/vcpkg_${{ matrix.os}}_llvm-${{ matrix.llvm }}_xcode-15.0_amd64/scripts/buildsystems/vcpkg.cmake | |
export INSTALL_DIR=$(pwd)/remill-preset-install | |
./scripts/build-preset.sh release | |
- name: Run tests | |
shell: bash | |
working-directory: remill-build | |
run: | | |
cmake --build . --target install -- -j "$(sysctl -n hw.logicalcpu)" | |
cmake --build . --target test_dependencies -- -j "$(sysctl -n hw.logicalcpu)" | |
env CTEST_OUTPUT_ON_FAILURE=1 cmake --build . --target test -- -j "$(sysctl -n hw.logicalcpu)" | |
- name: Smoketests with installed executable | |
shell: bash | |
run: | | |
remill-lift-${{ matrix.llvm }} --arch amd64 --ir_out /dev/stdout --bytes c704ba01000000 | |
remill-lift-${{ matrix.llvm }} --arch aarch64 --ir_out /dev/stdout --address 0x400544 --bytes FD7BBFA90000009000601891FD030091B7FFFF97E0031F2AFD7BC1A8C0035FD6 | |
remill-lift-${{ matrix.llvm }} --arch aarch32 -ir_out /dev/stderr --bytes 0cd04de208008de504108de500208de508309de504009de500109de5903122e0c20fa0e110109fe5001091e5002081e5040081e50cd08de21eff2fe14000000000000000 | |
- name: Locate the packages | |
id: package_names | |
shell: bash | |
working-directory: remill-build | |
run: | | |
echo ::set-output name=TGZ_PACKAGE_PATH::remill-build/$(ls *.tar.gz) | |
- name: Store the TGZ package | |
uses: actions/upload-artifact@v1 | |
with: | |
name: ${{ matrix.os }}_llvm${{ matrix.llvm }}_tgz_package | |
path: ${{ steps.package_names.outputs.TGZ_PACKAGE_PATH }} | |
release_packages: | |
# Do not run the release procedure if any of the builds has failed | |
needs: [build_linux, build_mac] | |
runs-on: ubuntu-22.04 | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
steps: | |
- name: Clone the remill repository | |
uses: actions/checkout@v2 | |
with: | |
path: remill | |
fetch-depth: 0 | |
- name: Generate the changelog | |
shell: bash | |
working-directory: remill | |
run: | | |
./scripts/generate_changelog.sh changelog.md | |
- name: Download all artifacts | |
uses: actions/download-artifact@v2 | |
- name: Draft the new release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Version ${{ github.ref }} | |
body_path: remill/changelog.md | |
draft: true | |
prerelease: true | |
- name: Group the packages by platform | |
run: | | |
zip -r9 remill_ubuntu-22.04_packages.zip \ | |
ubuntu-22.04* | |
zip -r9 remill_macos-12_packages.zip \ | |
macos-12* | |
- name: Upload the Ubuntu 22.04 packages | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: remill_ubuntu-22.04_packages.zip | |
asset_name: remill_ubuntu-22.04_packages.zip | |
asset_content_type: application/gzip | |
- name: Upload the macOS 11 packages | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: remill_macos-12_packages.zip | |
asset_name: remill_macos-12_packages.zip | |
asset_content_type: application/gzip | |
Docker_Linux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
llvm: ["17"] | |
ubuntu: ["22.04"] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build LLVM ${{ matrix.llvm }} on ${{ matrix.ubuntu }} | |
run: | | |
docker build . -t ghcr.io/lifting-bits/remill/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}:latest -f Dockerfile --build-arg UBUNTU_VERSION=${{ matrix.ubuntu }} --build-arg LLVM_VERSION=${{ matrix.llvm }} | |
- name: Test Docker image | |
run: | | |
docker run --rm ghcr.io/lifting-bits/remill/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}:latest --arch amd64 --ir_out /dev/stdout --bytes c704ba01000000 | |
docker run --rm ghcr.io/lifting-bits/remill/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}:latest --arch aarch64 --ir_out /dev/stdout --address 0x400544 --bytes FD7BBFA90000009000601891FD030091B7FFFF97E0031F2AFD7BC1A8C0035FD6 | |
docker run --rm ghcr.io/lifting-bits/remill/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}:latest --arch aarch32 -ir_out /dev/stderr --bytes 0cd04de208008de504108de500208de508309de504009de500109de5903122e0c20fa0e110109fe5001091e5002081e5040081e50cd08de21eff2fe14000000000000000 |