Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor build scripts to facilitate better portability, ruby and tebako integration #30

Merged
merged 5 commits into from
Apr 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 0 additions & 56 deletions .github/workflows/alpine-build.yml

This file was deleted.

129 changes: 129 additions & 0 deletions .github/workflows/alpine-x86_64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: Alpine-x86_64

on:
push:
paths-ignore:
- '.github/workflows/macos-x86_64.yml'
- '.github/workflows/macos-arm64.yml'
- '.github/workflows/ubuntu-x86_64.yml'
- '.github/workflows/ubuntu-aarch64.yml'
- '.github/workflows/windows-x86_64.yml'
- '.github/workflows/msys-x86_64.yml'
pull_request:
workflow_dispatch:

env:
BUILD_TYPE: Release
VCPKG_FORCE_SYSTEM_BINARIES: 1
CC: gcc
CXX: g++

jobs:
build-and-test:
runs-on: ubuntu-latest
container:
image: alpine:latest

steps:
- name: Install packages
run: |
apk --no-cache --upgrade add build-base cmake git valgrind tar argp-standalone \
gcompat gperf flex bison gettext-dev python3 ninja zip unzip curl pkgconfig \
libxml2-utils font-noto-hebrew font-noto-arabic

# vcpkg prerequisites (and VCPKG_FORCE_SYSTEM_BINARIES: 1)
# gcompat gperf flex bison gettext-dev python3 ninja zip unzip curl pkg-config
# testing prerequisites
# libxml2-utils
# [ tests/resources/emf/test-183.emf ] -- font-noto-hebrew font-noto-arabic

- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Configure cache
run: |
echo 'VCPKG_DEFAULT_BINARY_CACHE<<EOF' >> $GITHUB_ENV
echo "$(pwd)/cache" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV

- name: Create cache storage and cache key
run: |
mkdir ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
git submodule status > sm.txt

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

- name: Configure CMake
run: |
cmake -B . -DCMAKE_BUILD_TYPE=Release -DVCPKG_TARGET_TRIPLET=x64-linux -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake

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

- name: Test well formed files
run: ./tests/resources/check_correctness.sh -r -s

- name: Test corrupted files
run: ./tests/resources/check_correctness.sh -r -s -e tests/resources/emf-corrupted/ -xN

- name: Test EA files
run: ./tests/resources/check_correctness.sh -r -s -e tests/resources/emf-ea/

build-for-ruby:
runs-on: ubuntu-latest
container:
image: alpine:latest

steps:
- name: Install packages
run: |
apk --no-cache --upgrade add build-base cmake git tar bash \
gcompat gperf flex bison gettext-dev python3 ninja zip unzip curl pkgconfig

- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Configure cache
run: |
echo 'VCPKG_DEFAULT_BINARY_CACHE<<EOF' >> $GITHUB_ENV
echo "$(pwd)/cache" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV

- name: Create cache storage and cache key
run: |
mkdir ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
git submodule status > sm.txt

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

- name: Configure CMake
run: |
cmake -B . -DCMAKE_BUILD_TYPE=Release \
-DVCPKG_TARGET_TRIPLET=x64-linux \
-DLONLY=ON \
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake

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

- name: Checkout shell test framework
uses: actions/checkout@v3
with:
repository: kward/shunit2
path: tests/shunit2
fetch-depth: 1

- name: Run additional tests
run: tests/resources/lcheck.sh
58 changes: 40 additions & 18 deletions .github/workflows/macos-arm64.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,68 @@
name: MacOS-arm64 build
name: MacOS-arm64

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

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

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

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

- name: Setup environment
run: |
echo 'BREW_HOME<<EOF' >> $GITHUB_ENV
brew --prefix >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV

- name: Install packages
run: brew install bash

- name: Create cache storage and cache key
run: |
mkdir ${{env.VCPKG_DEFAULT_BINARY_CACHE}}
mkdir ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
git submodule status > sm.txt

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

- 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-osx
cmake -B ${{ github.workspace }} \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-DVCPKG_TARGET_TRIPLET=arm64-osx \
-DLONLY=ON \
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake

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

- name: Checkout shell test framework
uses: actions/checkout@v3
with:
repository: kward/shunit2
path: tests/shunit2
fetch-depth: 1

- name: Run additional tests
run: ${{ env.BREW_HOME }}/bin/bash tests/resources/lcheck.sh
36 changes: 0 additions & 36 deletions .github/workflows/macos-build.yml

This file was deleted.

Loading