Update Docker and docs #1492
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: | |
branches: | |
- '*' | |
env: | |
CC: clang | |
CXX: clang++ | |
jobs: | |
build_linux: | |
strategy: | |
fail-fast: false | |
matrix: | |
image: | |
- { name: 'ubuntu', tag: '22.04' } | |
llvm: [ | |
'16' | |
] | |
name: Rellic CI | |
runs-on: "gha-ubuntu-32" | |
container: | |
image: ghcr.io/lifting-bits/cxx-common/vcpkg-builder-${{ matrix.image.name }}-v2:${{ matrix.image.tag }} | |
credentials: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Adding github workspace as safe directory | |
# See issue https://github.com/actions/checkout/issues/760 | |
run: git config --global --add safe.directory $GITHUB_WORKSPACE | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Install utility tools | |
shell: bash | |
run: | | |
# TODO some of these should probably live in the Docker build image | |
apt-get update | |
apt-get install -y ninja-build pixz xz-utils make rpm python3 | |
- name: Build with build script | |
shell: bash | |
run: | | |
./scripts/build.sh --download-dir "$(pwd)/../pre-built-llvm-${{ matrix.llvm }}" --llvm-version ${{ matrix.llvm }} | |
cmake --build rellic-build --target install | |
- name: Tests | |
shell: bash | |
working-directory: rellic-build | |
run: | | |
# Test with CMake provided test | |
env CTEST_OUTPUT_ON_FAILURE=1 cmake --build . --target test | |
- name: Build with CMake Presets | |
shell: bash | |
run: | | |
export CMAKE_TOOLCHAIN_FILE=${GITHUB_WORKSPACE}/${VCPKG_ROOT_PART}/scripts/buildsystems/vcpkg.cmake | |
export INSTALL_DIR=${GITHUB_WORKSPACE}/${INSTALL_DIR_PART} | |
scripts/build-preset.sh debug | |
env: | |
VCPKG_ROOT_PART: ../pre-built-llvm-${{ matrix.llvm }}/vcpkg_${{ matrix.image.name }}-${{ matrix.image.tag }}_llvm-${{ matrix.llvm }}_amd64 | |
INSTALL_DIR_PART: ../rellic-install | |
- name: Locate the packages | |
id: package_names | |
shell: bash | |
working-directory: rellic-build | |
run: | | |
echo "DEB_PACKAGE_PATH=rellic-build/$(ls *.deb)" >> ${GITHUB_OUTPUT} | |
echo "RPM_PACKAGE_PATH=rellic-build/$(ls *.rpm)" >> ${GITHUB_OUTPUT} | |
echo "TGZ_PACKAGE_PATH=rellic-build/$(ls *.tar.gz)" >> ${GITHUB_OUTPUT} | |
- name: Install the DEB package | |
run: | | |
dpkg -i ${{ steps.package_names.outputs.DEB_PACKAGE_PATH }} | |
- name: Test the DEB package | |
run: | | |
rellic-decomp --version | |
- name: Run Integration Tests (AnghaBench 1K, LLVM 14) | |
if: ${{ matrix.llvm == '14' && matrix.image.tag == '20.04' }} | |
shell: bash | |
run: | | |
apt-get install -y clang-${{ matrix.llvm }} | |
python3 -m pip install -r external/lifting-tools-ci/requirements.txt | |
scripts/test-angha-1k.sh \ | |
--rellic-cmd "rellic-decomp" | |
- 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-12' | |
] | |
llvm: [ | |
'16' | |
] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Adding github workspace as safe directory | |
# See issue https://github.com/actions/checkout/issues/760 | |
run: git config --global --add safe.directory $GITHUB_WORKSPACE | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Install Ninja Build | |
run: brew install ninja | |
- name: Build with build script | |
shell: bash | |
run: | | |
./scripts/build.sh --download-dir "$(pwd)/../pre-built-llvm-${{ matrix.llvm }}" --llvm-version ${{ matrix.llvm }} | |
cmake --build rellic-build --target install | |
- name: Tests | |
shell: bash | |
working-directory: rellic-build | |
run: | | |
# Test with CMake provided test | |
env CTEST_OUTPUT_ON_FAILURE=1 cmake --build . --target test | |
- name: Locate the packages | |
id: package_names | |
shell: bash | |
working-directory: rellic-build | |
run: | | |
echo "TGZ_PACKAGE_PATH=rellic-build/$(ls *.tar.gz)" >> ${GITHUB_OUTPUT} | |
- 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: Adding github workspace as safe directory | |
# See issue https://github.com/actions/checkout/issues/760 | |
run: git config --global --add safe.directory $GITHUB_WORKSPACE | |
- name: Clone the rellic repository | |
uses: actions/checkout@v2 | |
with: | |
path: rellic | |
fetch-depth: 0 | |
submodules: true | |
- name: Generate the changelog | |
shell: bash | |
working-directory: rellic | |
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: rellic/changelog.md | |
draft: true | |
prerelease: true | |
- name: Group the packages by platform | |
run: | | |
zip -r9 rellic_ubuntu-22.04_packages.zip \ | |
ubuntu-22.04* | |
zip -r9 rellic_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: rellic_ubuntu-22.04_packages.zip | |
asset_name: rellic_ubuntu-22.04_packages.zip | |
asset_content_type: application/gzip | |
- name: Upload the macOS 12 packages | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: rellic_macos-12_packages.zip | |
asset_name: rellic_macos-12_packages.zip | |
asset_content_type: application/gzip | |
Docker_Linux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
llvm: ["16"] | |
ubuntu: ["22.04"] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Build LLVM ${{ matrix.llvm }} on ${{ matrix.ubuntu }} | |
run: | | |
docker build . -t docker.pkg.github.com/lifting-bits/rellic/rellic-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}-amd64:latest -f Dockerfile --build-arg UBUNTU_VERSION=${{ matrix.ubuntu }} --build-arg ARCH=amd64 --build-arg LLVM_VERSION=${{ matrix.llvm }} | |
- name: Test Docker image | |
run: | | |
docker run --rm docker.pkg.github.com/lifting-bits/rellic/rellic-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}-amd64:latest --version |