Skip to content

Commit

Permalink
arm64-linux (aka aarch64) cross-compilation (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxirmx authored Mar 19, 2022
1 parent ecba815 commit 16b4a6e
Show file tree
Hide file tree
Showing 39 changed files with 330 additions and 236 deletions.
69 changes: 36 additions & 33 deletions .github/workflows/macos-build.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
name: MacOS build

on:
push:
branches:
- master
pull_request:

env:
BUILD_TYPE: Release

jobs:
MacOS-build:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2

- name: Install packages MacOS
run: |
brew install argp-standalone
brew install coreutils
brew install lcov
# brew tap LouisBrunner/valgrind
# brew install --HEAD LouisBrunner/valgrind/valgrind

- name: Configure CMake
run: cmake -B ${{github.workspace}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
run: cmake --build ${{github.workspace}} --config ${{env.BUILD_TYPE}}


name: MacOS build

on:
push:
branches: [ master ]
paths-ignore:
- '.github/workflows/ubuntu-build.yml'
- '.github/workflows/ubuntu-aarch64.yml'
- '.github/workflows/windows-build.yml'
pull_request:
workflow_dispatch:

env:
BUILD_TYPE: Release

jobs:
MacOS-build:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2

- name: Install packages
run: |
brew install argp-standalone coreutils
# brew install lcov
# brew tap LouisBrunner/valgrind
# brew install --HEAD LouisBrunner/valgrind/valgrind

- name: Configure CMake
run: cmake -B ${{github.workspace}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
run: cmake --build ${{github.workspace}} --config ${{env.BUILD_TYPE}}


57 changes: 57 additions & 0 deletions .github/workflows/ubuntu-aarch64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Ubuntu-aarch64 build

on:
push:
branches: [ master ]
paths-ignore:
- '.github/workflows/ubuntu-build.yml'
- '.github/workflows/macos-build.yml'
- '.github/workflows/windows-build.yml'
pull_request:
workflow_dispatch:

env:
BUILD_TYPE: Release
VCPKG_DEFAULT_BINARY_CACHE: ${{github.workspace}}/cache

jobs:
Ubuntu-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
submodules: recursive

- name: Create cache storage and cache key
run: |
mkdir ${{env.VCPKG_DEFAULT_BINARY_CACHE}}
git submodule status > sm.txt
- uses: actions/cache@v2
with:
path: ${{env.VCPKG_DEFAULT_BINARY_CACHE}}
key: ${{runner.os}}-vcpkg-${{ hashFiles('sm.txt') }}

- name: Install packages
run: |
sudo apt-get update
sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu gperf qemu-user
- name: Configure CMake
run: |
cmake -B ${{github.workspace}} \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_TARGET_TRIPLET=arm64-linux
- name: Build
run: cmake --build ${{github.workspace}} --config ${{env.BUILD_TYPE}}

- name: Smoke test
run: |
qemu-aarch64 -L /usr/aarch64-linux-gnu ${{github.workspace}}/emf2svg-conv --version
qemu-aarch64 -L /usr/aarch64-linux-gnu ${{github.workspace}}/emf2svg-conv \
-i ${{github.workspace}}/tests/resources/emf/test-000.emf -o test-000.svg
ls | grep test-000.svg
153 changes: 78 additions & 75 deletions .github/workflows/ubuntu-build.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,78 @@
name: Ubuntu build

on:
push:
branches:
- master
pull_request:

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
Ubuntu-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install packages Ubuntu
run: |
sudo apt-get update
sudo apt-get install libxml2-utils valgrind
- name: Configure CMake
run: cmake -B ${{github.workspace}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
run: cmake --build ${{github.workspace}} --config ${{env.BUILD_TYPE}}

- name: Test well formed files
working-directory: ${{github.workspace}}
run: ./tests/resources/check_correctness.sh -r -s

- name: Test corrupted files
working-directory: ${{github.workspace}}
run: ./tests/resources/check_correctness.sh -r -s -e tests/resources/emf-corrupted/ -xN

- name: Test EA files
working-directory: ${{github.workspace}}
run: ./tests/resources/check_correctness.sh -r -s -e tests/resources/emf-ea/

coverage:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install packages
run: |
sudo apt-get update
sudo apt-get install libxml2-utils valgrind lcov
- name: Install coveralls
run: sudo pip install cpp-coveralls

- name: Configure CMake
run: cmake -B ${{github.workspace}} -DCMAKE_BUILD_TYPE=Debug -DGCOV=ON

- name: Build
run: make coverage

- name: Report
run: |
coveralls \
-t ${{ secrets.COVERALLS_REPO_TOKEN }} \
-E '.*CMakeFiles.*' \
-E '.*conv.*' \
-E '.*uemf.*' \
-E '.*upmf.*' \
-E '.*goodies.*' \
-E '.*tests.*' \
--gcov-options '\-lp'
name: Ubuntu build

on:
push:
branches: [ master ]
paths-ignore:
- '.github/workflows/macos-build.yml'
- '.github/workflows/ubuntu-aarch64.yml'
- '.github/workflows/windows-build.yml'
pull_request:
workflow_dispatch:

env:
BUILD_TYPE: Release

jobs:
Ubuntu-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install packages
run: |
sudo apt-get update
sudo apt-get install libxml2-utils valgrind
- name: Configure CMake
run: cmake -B ${{github.workspace}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
run: cmake --build ${{github.workspace}} --config ${{env.BUILD_TYPE}}

- name: Test well formed files
working-directory: ${{github.workspace}}
run: ./tests/resources/check_correctness.sh -r -s

- name: Test corrupted files
working-directory: ${{github.workspace}}
run: ./tests/resources/check_correctness.sh -r -s -e tests/resources/emf-corrupted/ -xN

- name: Test EA files
working-directory: ${{github.workspace}}
run: ./tests/resources/check_correctness.sh -r -s -e tests/resources/emf-ea/

coverage:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install packages
run: |
sudo apt-get update
sudo apt-get install libxml2-utils valgrind lcov
- name: Install coveralls
run: sudo pip install cpp-coveralls

- name: Configure CMake
run: cmake -B ${{github.workspace}} -DCMAKE_BUILD_TYPE=Debug -DGCOV=ON

- name: Build
run: make coverage

- name: Report
run: |
coveralls \
-t ${{ secrets.COVERALLS_REPO_TOKEN }} \
-E '.*CMakeFiles.*' \
-E '.*conv.*' \
-E '.*uemf.*' \
-E '.*upmf.*' \
-E '.*goodies.*' \
-E '.*tests.*' \
--gcov-options '\-lp'
93 changes: 47 additions & 46 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
name: Windows build

on:
push:
branches:
- master
pull_request:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
BUILD_TYPE: Release
VCPKG_DEFAULT_BINARY_CACHE: ${{github.workspace}}/cache

jobs:
Windows-build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
with:
submodules: recursive

- name: Create cache storage and cache key
run: |
mkdir ${{env.VCPKG_DEFAULT_BINARY_CACHE}}
git submodule status > sm.txt
# Something like " 025e564979cc01d0fbc5c920aa8a36635efb01bb vcpkg (2020.04-3294-g025e56497)"
# to be used as cache key

- uses: actions/cache@v2
with:
path: ${{env.VCPKG_DEFAULT_BINARY_CACHE}}
key: ${{runner.os}}-vcpkg-${{ hashFiles('sm.txt') }}

- name: Configure
run: >
cmake
-B ${{github.workspace}}
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Build
run: cmake --build ${{github.workspace}} --config ${{env.BUILD_TYPE}}

name: Windows build

on:
push:
branches: [ master ]
paths-ignore:
- '.github/workflows/macos-build.yml'
- '.github/workflows/ubuntu-aarch64.yml'
- '.github/workflows/ubuntu-build.yml'
pull_request:
workflow_dispatch:

env:
BUILD_TYPE: Release
VCPKG_DEFAULT_BINARY_CACHE: ${{github.workspace}}/cache

jobs:
Windows-build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
with:
submodules: recursive

- name: Create cache storage and cache key
run: |
mkdir ${{env.VCPKG_DEFAULT_BINARY_CACHE}}
git submodule status > sm.txt
# Something like " 025e564979cc01d0fbc5c920aa8a36635efb01bb vcpkg (2020.04-3294-g025e56497)"
# to be used as cache key

- uses: actions/cache@v2
with:
path: ${{env.VCPKG_DEFAULT_BINARY_CACHE}}
key: ${{runner.os}}-vcpkg-${{ hashFiles('sm.txt') }}

- name: Configure
run: >
cmake
-B ${{github.workspace}}
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Build
run: cmake --build ${{github.workspace}} --config ${{env.BUILD_TYPE}}

Loading

0 comments on commit 16b4a6e

Please sign in to comment.