bitswap() operations (#65) #366
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: Build Linux | |
on: | |
workflow_dispatch: | |
workflow_call: | |
push: | |
branches: | |
- 'master' | |
tags: | |
- '*' | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 30 | |
env: | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
MODE: release | |
TARGET_OS: linux | |
ARCH: ${{ matrix.arch }} | |
TARGET_CPUREV: ${{ matrix.cpurev }} | |
JOBS: 4 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04, ubuntu-22.04] | |
arch: [amd64, i386, arm64, armhf] | |
cpurev: [legacy, default, modern] | |
steps: | |
# Checkout | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# Purge PPA | |
- name: Purge PPA | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y ppa-purge aptitude | |
sudo ppa-purge -y ppa:ubuntu-toolchain-r/test | |
# Cross-Compile Support | |
- name: Cross-Compile Support | |
uses: cyberjunk/gha-ubuntu-cross@v4 | |
if: matrix.arch != 'amd64' | |
with: | |
arch: ${{ matrix.arch }} | |
# Ubuntu Packages | |
- name: Ubuntu Packages | |
run: sudo apt-get install clang llvm libx11-dev:$ARCH | |
# QEMU (ARM64/ARMHF) | |
- name: QEMU (ARM64/ARMHF) | |
if: matrix.arch == 'arm64' || matrix.arch == 'armhf' || matrix.arch == 'armel' | |
run: sudo apt-get install qemu-user qemu-user-static | |
# Set Environment Vars | |
- name: Set Environment Vars | |
run: | | |
if [ $ARCH == amd64 ]; then \ | |
echo "TARGET_ARCH=x64" >> $GITHUB_ENV; \ | |
echo "TARGET=x86_64-linux-gnu" >> $GITHUB_ENV; \ | |
fi | |
if [ $ARCH == i386 ]; then \ | |
echo "TARGET_ARCH=x86" >> $GITHUB_ENV; \ | |
echo "TARGET=i686-linux-gnu" >> $GITHUB_ENV; \ | |
fi | |
if [ $ARCH == arm64 ]; then \ | |
echo "TARGET_ARCH=arm64" >> $GITHUB_ENV; \ | |
echo "TARGET=aarch64-linux-gnu" >> $GITHUB_ENV; \ | |
fi | |
if [ $ARCH == armhf ]; then \ | |
echo "TARGET_ARCH=arm" >> $GITHUB_ENV; \ | |
echo "TARGET=arm-linux-gnueabihf" >> $GITHUB_ENV; \ | |
fi | |
# Clang Version | |
- name: Clang Version | |
run: clang --version | |
# Build | |
- name: Build | |
run: | | |
echo MODE: $MODE | |
echo ARCH: $ARCH | |
echo TARGET: $TARGET | |
echo TARGET_ARCH: $TARGET_ARCH | |
echo TARGET_CPUREV: $TARGET_CPUREV | |
clang++ --target=$TARGET -v | |
make -v | |
make -j${{ env.JOBS }} | |
# Binary Info | |
- name: Binary Info | |
if: matrix.arch == 'amd64' || matrix.arch == 'i386' | |
run: | | |
echo CppCore.Example.Server | |
ldd ./build/make/bin/linux-${{ env.TARGET_ARCH }}/CppCore.Example.Server | |
echo CppCore.Example.Client | |
ldd ./build/make/bin/linux-${{ env.TARGET_ARCH }}/CppCore.Example.Client | |
echo CppCore.Example.UI | |
ldd ./build/make/bin/linux-${{ env.TARGET_ARCH }}/CppCore.Example.UI | |
echo CppCore.Test | |
ldd ./build/make/bin/linux-${{ env.TARGET_ARCH }}/CppCore.Test | |
echo CppCore.Debug | |
ldd ./build/make/bin/linux-${{ env.TARGET_ARCH }}/CppCore.Debug | |
# Test | |
- name: Test | |
run: make test | |
# Make (dist) | |
- name: Make (dist) | |
run: make dist -j${{ env.JOBS }} | |
# Upload | |
- name: Upload | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Packages (${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.cpurev }}) | |
path: ./dist/${{ matrix.os }}/*.deb | |
# Upload to Github Release | |
- name: Upload to Github Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') && (matrix.cpurev == 'default') | |
with: | |
token: ${{ secrets.PAT_GITHUB_ACTIONS }} | |
files: ./dist/${{ matrix.os }}/*.deb |