Skip to content

Commit

Permalink
tebako v0.3.3 and workflow optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
maxirmx committed Jan 29, 2022
1 parent c1533c6 commit 666f7ff
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 121 deletions.
78 changes: 5 additions & 73 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,81 +27,14 @@ env:
TEBAKO_DIR: .archive/tebako
DEPS: deps
# Versions
TEBAKO_TAG: "maxirmx_v0.3.3"
TEBAKO_TAG: "v0.3.3"
RUBY_VER: "2.7.5"
RUBY_HASH: "2755b900a21235b443bb16dadd9032f784d4a88f143d852bc5d154f22b8781f1"
BUNDLER_VER: "2.2.3"

jobs:
setup:
runs-on: ubuntu-18.04
steps:

# Note. This step is required on ubuntu-18 only. GHA ubuntu-20 works off-the-shelf
- name: Switch to gcc-9
run: |
sudo update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-9 100 \
--slave /usr/bin/g++ g++ /usr/bin/g++-9 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-9
sudo update-alternatives --set gcc /usr/bin/gcc-9
- name: Install packages
run: |
sudo apt-get -y update
sudo apt-get -y install \
binutils-dev libarchive-dev libevent-dev libjemalloc-dev acl-dev \
libdouble-conversion-dev libiberty-dev liblz4-dev liblzma-dev \
libssl-dev libboost-context-dev libboost-filesystem-dev \
libboost-program-options-dev libboost-regex-dev \
libboost-system-dev libboost-thread-dev libunwind-dev libdwarf-dev \
libelf-dev libfuse-dev libgoogle-glog-dev libffi-dev libgdbm-dev \
libyaml-dev libncurses-dev libreadline-dev libsqlite3-dev
# Note. ppa:team-xbmc is required on ubuntu-18 only. GHA ubuntu-20 will
# work with 'sudo apt-get install libfmt-dev'
- name: Update libfmt (bionic)
run: |
sudo apt-get -y remove libfmt-dev
sudo apt-get -y install software-properties-common
sudo add-apt-repository ppa:team-xbmc/ppa
sudo apt-get -y update
sudo apt-get -y install libfmt-dev
- name: Install libjemalloc 5
run: |
sudo apt-get remove libjemalloc-dev
wget -q https://github.com/jemalloc/jemalloc/releases/download/5.2.1/jemalloc-5.2.1.tar.bz2
tar -xf jemalloc-5.2.1.tar.bz2
cd jemalloc-5.2.1
./configure --prefix='/usr'
make
sudo make install
- name: Checkout tebako packaging environment
uses: actions/checkout@v2
with:
repository: tamatebako/tebako
path: ${{ env.TEBAKO_DIR }}
ref: ${{ env.TEBAKO_TAG }}

- name: Create deps folder
run: mkdir -p -v ${{ env.TEBAKO_DIR }}/${{ env.DEPS }}

- name: Tebako setup cache
id: cache
uses: actions/cache@v2
with:
path: ${{ env.TEBAKO_DIR }}/${{ env.DEPS }}
key: ${{ github.workflow }}-${{ env.OS_VER }}-${{ env.CC }}-${{ env.TEBAKO_TAG }}-${{ env.RUBY_HASH }}-v${{ env.CACHE_VER }}

- name: Tebako setup
if: steps.cache.outputs.cache-hit != 'true'
run: ${{ env.TEBAKO_DIR }}/bin/tebako setup

build:
runs-on: ubuntu-18.04
needs: setup
steps:
- uses: actions/checkout@v2

Expand All @@ -119,7 +52,7 @@ jobs:
run: |
sudo apt-get -y update
sudo apt-get -y install \
binutils-dev libarchive-dev libevent-dev acl-dev \
binutils-dev libarchive-dev libevent-dev libjemalloc-dev acl-dev \
libdouble-conversion-dev libiberty-dev liblz4-dev liblzma-dev \
libssl-dev libboost-context-dev libboost-filesystem-dev \
libboost-program-options-dev libboost-regex-dev \
Expand Down Expand Up @@ -170,11 +103,10 @@ jobs:
path: ${{ env.TEBAKO_DIR }}/${{ env.DEPS }}
key: ${{ github.workflow }}-${{ env.OS_VER }}-${{ env.CC }}-${{ env.TEBAKO_TAG }}-${{ env.RUBY_HASH }}-v${{ env.CACHE_VER }}

- name: Tebako cache check
- name: Tebako setup
if: steps.cache.outputs.cache-hit != 'true'
run: |
echo "Failed to load cache"
false
run: ${{ env.TEBAKO_DIR }}/bin/tebako setup

# ------- End of tebako prerequisites

- uses: metanorma/metanorma-build-scripts/gh-rubygems-setup-action@main
Expand Down
51 changes: 4 additions & 47 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,65 +26,23 @@ env:
TEBAKO_DIR: .archive/tebako
DEPS: deps
# Versions
TEBAKO_TAG: "maxirmx_v0.3.3"
TEBAKO_TAG: "v0.3.3"
RUBY_VER: "2.7.5"
RUBY_HASH: "2755b900a21235b443bb16dadd9032f784d4a88f143d852bc5d154f22b8781f1"
BUNDLER_VER: "2.2.3"

jobs:
setup:
runs-on: macos-10.15
steps:
- name: Select XCode 12.1.1 & SDK 10.15
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '12.1.1'

- name: Install packages
run: |
brew install \
bison flex binutils libarchive double-conversion boost jemalloc fmt glog \
gnu-getopt gnu-sed bash ncurses
- name: Checkout tebako packaging environment
uses: actions/checkout@v2
with:
repository: tamatebako/tebako
path: ${{ env.TEBAKO_DIR }}
ref: ${{ env.TEBAKO_TAG }}

- name: Create deps folder
run: mkdir -p -v ${{ env.TEBAKO_DIR }}/${{ env.DEPS }}

- name: Tebako setup cache
id: cache
uses: actions/cache@v2
with:
path: ${{ env.TEBAKO_DIR }}/${{ env.DEPS }}
key: ${{ github.workflow }}-${{ env.OS_VER }}-${{ env.CC }}-${{ env.TEBAKO_TAG }}-${{ env.RUBY_HASH }}-v${{ env.CACHE_VER }}

- name: Tebako setup
if: steps.cache.outputs.cache-hit != 'true'
run: ${{ env.TEBAKO_DIR }}/bin/tebako setup

build:
runs-on: macos-10.15
needs: setup
steps:
- uses: actions/checkout@v2

# ---------- Start of tebako prerequisites
- name: Select XCode 12.1.1 & SDK 10.15
uses: maxim-lobanov/setup-xcode@v1

with:
xcode-version: '12.1.1'

- name: Checkout tebako packaging environment
uses: actions/checkout@v2
with:
fetch-depth: 1

- name: Install packages
run: |
brew install \
Expand Down Expand Up @@ -114,11 +72,10 @@ jobs:
path: ${{ env.TEBAKO_DIR }}/${{ env.DEPS }}
key: ${{ github.workflow }}-${{ env.OS_VER }}-${{ env.CC }}-${{ env.TEBAKO_TAG }}-${{ env.RUBY_HASH }}-v${{ env.CACHE_VER }}

- name: Tebako cache check
- name: Tebako setup
if: steps.cache.outputs.cache-hit != 'true'
run: |
echo "Failed to load cache"
false
run: ${{ env.TEBAKO_DIR }}/bin/tebako setup

# ------- End of tebako prerequisites

- uses: metanorma/metanorma-build-scripts/gh-rubygems-setup-action@main
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ TEST_FLAVOR ?= iso
TEST_PROCESSORS ?= iso cc iec un m3aawg jcgm csa bipm iho ogc itu ietf

BUILD_DIR := build
TEBAKO_TAG := maxirmx_v0.3.3
TEBAKO_TAG := v0.3.3

all: $(BUILD_DIR)/bin/metanorma-$(PLATFORM)-$(ARCH)

Expand Down

0 comments on commit 666f7ff

Please sign in to comment.