Make Crypto module opt-out #389
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: CI Build | |
env: | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
PROJECT_NAME: "pwn++" | |
REPO: hugsy/pwn-- | |
on: | |
pull_request: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: "${{ matrix.variants.os }}/${{ matrix.variants.arch }}/${{ matrix.variants.config }}" | |
env: | |
CMAKE_FLAGS: '-DPWN_BUILD_DOCS=OFF -DPWN_DISASSEMBLE_X86=ON -DPWN_DISASSEMBLE_ARM64=ON -DPWN_BUILD_TOOLKIT=ON -DPWN_BUILD_TESTING=ON -DPWN_BUILD_CRYPTO=ON' | |
NB_CPU: 1 | |
VERBOSE: 1 | |
strategy: | |
fail-fast: false | |
matrix: | |
variants: | |
- {os: windows-2022, arch: x64, config: RelWithDebInfo} | |
- {os: windows-2022, arch: win32, config: RelWithDebInfo} | |
- {os: windows-2022, arch: arm64, config: RelWithDebInfo} | |
- {os: windows-2022, arch: arm, config: RelWithDebInfo} | |
# - {os: ubuntu-2204, arch: x64, config: RelWithDebInfo} # runner fails for some reason, works fine locally: see https://github.com/actions/runner-images/discussions/7188 | |
# - {os: ubuntu-2204, arch: x86, config: RelWithDebInfo} | |
runs-on: ${{ matrix.variants.os }} | |
outputs: | |
windows-2022-x64: ${{ join(steps.*.outputs.windows-2022-x64,'') }} | |
windows-2022-win32: ${{ join(steps.*.outputs.windows-2022-win32,'') }} | |
windows-2022-arm: ${{ join(steps.*.outputs.windows-2022-arm,'') }} | |
windows-2022-arm64: ${{ join(steps.*.outputs.windows-2022-arm64,'') }} | |
# ubuntu-2204-x64: ${{ join(steps.*.outputs.ubuntu-2204-x64,'') }} | |
# ubuntu-2204-x86: ${{ join(steps.*.outputs.ubuntu-2204-x86,'') }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup environment variables (Windows) | |
if: startsWith(matrix.variants.os, 'windows-') | |
shell: powershell | |
run: | | |
echo "NB_CPU=$env:NUMBER_OF_PROCESSORS" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
Import-Module .\.github\Invoke-VisualStudio.ps1 | |
Invoke-VisualStudio2022${{ matrix.variants.arch }} | |
- name: Setup environment variables (Linux) | |
if: startsWith(matrix.variants.os, 'ubuntu-') | |
run: | | |
sudo apt remove llvm-* clang-* python3-lldb-* libunwind-* libc++abi1-* libc++1-* | |
wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh | |
chmod +x /tmp/llvm.sh | |
sudo /tmp/llvm.sh 17 | |
sudo apt update && sudo apt install -y cmake doxygen clang-17 libc++abi-17-dev libc++-17-dev llvm-17-dev nasm | |
echo "NB_CPU=$(grep -c ^processor /proc/cpuinfo)" >> $GITHUB_ENV | |
echo "CC=clang-17" >> $GITHUB_ENV | |
echo "CXX=clang++-17" >> $GITHUB_ENV | |
- name: Prepare common environment | |
run: | | |
mkdir build | |
mkdir artifact | |
- name: Prepare Windows environment | |
if: startsWith(matrix.variants.os, 'windows-') | |
shell: pwsh | |
run: | | |
New-Item -ItemType SymbolicLink -Target "..\pwn--" -Path "..\pwn++" -ErrorAction Continue | |
choco install gnuwin32-m4 | |
- name: Prepare Linux environment | |
if: startsWith(matrix.variants.os, 'ubuntu-') | |
shell: bash | |
run: | | |
echo ln -s ../pwn++ ../pwn-- | |
- name: Build environment information | |
run: env | |
- name: Initialize cmake | |
if: startsWith(matrix.variants.os, 'windows-') | |
run: | | |
cmake -S . -B ./build -A ${{ matrix.variants.arch }} ${{ env.CMAKE_FLAGS }} | |
- name: Initialize cmake (Linux) | |
if: startsWith(matrix.variants.os, 'ubuntu-') | |
run: | | |
cmake -S . -B ./build ${{ env.CMAKE_FLAGS }} | |
- name: Build pwn++ library | |
run: | | |
cmake --build ./build --parallel ${{ env.NB_CPU }} --config ${{ matrix.variants.config }} | |
- name: Run tests | |
if: matrix.variants.build == 'full' && matrix.variants.config == 'RelWithDebInfo' && ( matrix.variants.arch == 'x86' || matrix.variants.arch == 'x64' ) | |
continue-on-error: true | |
run: | | |
ctest --parallel ${{ env.NB_CPU }} --progress --build-config ${{ matrix.variants.config }} -T test --test-dir ./build | |
- name: Populate the successful output (Windows) | |
id: output_success_win | |
if: ${{ startsWith(matrix.variants.os, 'windows-') && success() }} | |
run: | | |
echo '${{ matrix.variants.os }}-${{ matrix.variants.arch }}=✅ ${{ matrix.variants.os }} ➤ ${{ matrix.variants.arch }}' | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append | |
- name: Populate the failure output (Windows) | |
id: output_failure_win | |
if: ${{ startsWith(matrix.variants.os, 'windows-') && failure() }} | |
run: | | |
echo '${{ matrix.variants.os }}-${{ matrix.variants.arch }}=❌ ${{ matrix.variants.os }} ➤ ${{ matrix.variants.arch }}' | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append | |
exit 0 | |
- name: Populate the successful output (Linux) | |
id: output_success_lin | |
if: ${{ startsWith(matrix.variants.os, 'ubuntu-') && success() }} | |
run: | | |
echo '${{ matrix.variants.os }}-${{ matrix.variants.arch }}=✅ ${{ matrix.variants.os }} ➤ ${{ matrix.variants.arch }}' >> ${GITHUB_OUTPUT} | |
- name: Populate the failure output (Linux) | |
id: output_failure_lin | |
if: ${{ startsWith(matrix.variants.os, 'ubuntu-') && failure() }} | |
run: | | |
echo '${{ matrix.variants.os }}-${{ matrix.variants.arch }}=❌ ${{ matrix.variants.os }} ➤ ${{ matrix.variants.arch }}' >> ${GITHUB_OUTPUT} | |
exit 0 | |
- name: Install library | |
run: | | |
cmake --install ./build --config ${{ matrix.variants.config }} --prefix ./artifact --verbose | |
- name: Publish artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.PROJECT_NAME }}_${{ matrix.variants.arch }}_${{ matrix.variants.os }}_${{ matrix.variants.config }}_${{ github.sha }}_${{ matrix.variants.build }} | |
path: artifact/ | |
# notify: | |
# runs-on: ubuntu-2204 | |
# needs: build | |
# steps: | |
# - name: Send Discord notification | |
# env: | |
# COMMIT_URL: "https://github.com/${{ env.REPO }}/commit/${{ github.sha }}" | |
# RUN_URL: "https://github.com/${{ env.REPO }}/actions/runs/${{ github.run_id }}" | |
# BRANCH_URL: "https://github.com/${{ env.REPO }}/tree/${{ github.ref_name }}" | |
# AUTHOR_URL: "https://github.com/${{ github.actor }}" | |
# uses: sarisia/[email protected] | |
# with: | |
# nodetail: true | |
# title: 🚧 🚧 Summary of Build `${{ github.sha }}` for `${{ env.REPO }}` 🚧 🚧 | |
# description: | | |
# [Job #${{ github.run_number }}](${{ env.RUN_URL }}): CI build `${{ github.sha }}` initiated by [${{ github.actor }}](${{ env.AUTHOR_URL }}): | |
# ● Commit [${{ github.sha }}](${{ env.COMMIT_URL }}) | |
# ● Branch [`${{ github.ref_name }}`](${{ env.BRANCH_URL }}) | |
# ● [Detail Page](${{ env.RUN_URL }}) | |
# ${{ needs.build.outputs.windows-2022-x64 }} | |
# ${{ needs.build.outputs.windows-2022-win32 }} | |
# ${{ needs.build.outputs.windows-2022-arm }} | |
# ${{ needs.build.outputs.windows-2022-arm64 }} | |
# color: 0x0000ff | |
# username: ${{ github.actor }} via GithubBot | |
# avatar_url: ${{ github.actor.avatar_url }} |