Skip to content

Commit

Permalink
Update linux workflow to use tebako
Browse files Browse the repository at this point in the history
  • Loading branch information
ronaldtse committed Dec 8, 2021
1 parent aa48b82 commit 9ccf8c6
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 191 deletions.
162 changes: 0 additions & 162 deletions .github/workflows/linux-tebako.yml

This file was deleted.

154 changes: 125 additions & 29 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,37 @@ on:
- .github/workflows/release_tag.yml
- Makefile.win

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

env:
# Customize tebako build type here
BUILD_TYPE: Release
# The folders
TEBAKO_DIR: tebako
DEPS: deps
# Versions
TEBAKO_TAG: maxirmx-issue-23
RUBY_VER: "2.7.4"
RUBY_HASH: "3043099089608859fc8cce7f9fdccaa1f53a462457e3838ec3b25a7d609fbc5b"
BUNDLER_VER: "2.2.3"

jobs:
build:
runs-on: ubuntu-18.04
name: ${{ matrix.os }} [CC ${{ matrix.env.CC }}]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
env:
- CC: gcc
CXX: g++
- CC: clang
CXX: clang++

if: "!contains(github.event.head_commit.message, 'skip ci')"
env: ${{ matrix.env }}
steps:
- uses: actions/checkout@v2

Expand All @@ -23,23 +51,33 @@ jobs:

- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.3
bundler: 2.2.3
ruby-version: ${{ env.RUBY_VER }}
bundler: ${{ env.BUNDLER_VER }}
bundler-cache: true

- run: bundle update --all

- run: sudo apt-get update && sudo apt-get -y -q install squashfs-tools bison flex texinfo

- run: |
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install -y \
ronn binutils-dev libarchive-dev libevent-dev libjemalloc-dev acl-dev libxml2-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 libfmt-dev libfuse3-dev libgoogle-glog-dev \
libffi-dev libgdbm-dev libyaml-dev libncurses-dev libreadline-dev libsqlite3-dev \
texinfo
# - run: |
# sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100
# sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100

- run: |
curl -Lks 'https://git.io/rg-ssl' | ruby
echo "perl -v: $(perl -v)"
echo "clang -v: $(clang -v)"
echo "clang++ -v: $(clang -v)"
echo "cc -v: $($CC -v)"
echo "CXX -v: $($CXX -v)"
- name: enable swap
run: |
Expand All @@ -49,19 +87,76 @@ jobs:
sudo swapon /compile.swap
sudo swapon --all --verbose
- run: make build/metanorma
timeout-minutes: 180
# https://trac.sagemath.org/ticket/19762
env:
CC: /usr/bin/clang
CXX: /usr/bin/clang++
- name: Checkout tebako packaging environment
uses: actions/checkout@v2
with:
repository: tamatebako/tebako
path: ${{ env.TEBAKO_DIR }}
ref: ${{ env.TEBAKO_TAG }}
fetch-depth: 0

- run: build/metanorma help
- name: Create deps folder and cache key
run: |
mkdir -p -v ${{ env.TEBAKO }}/${{ env.DEPS }}
echo "Keys" > key.txt
echo ${{ env.TEBAKO_DIR_TAG }} >> key.txt
echo ${{ env.RUBY_HASH }} >> key.txt
- name: Process cache
id: cache
uses: actions/cache@v2
with:
path: ${{ env.TEBAKO_DIR }}/${{ env.DEPS }}
key: ${{ github.workflow }}-${{ matrix.os }}-${{ matrix.env.CC }}-${{ hashFiles('key.txt') }}-v01

- name: tebako setup
if: steps.cache.outputs.cache-hit != 'true'
run: |
pushd ${{ env.TEBAKO_DIR }}
bin/tebako setup
popd
- name: package metanorma
timeout-minutes: 180
run: |
bin/build-with-tebako.sh
- uses: actions/upload-artifact@v2
with:
name: metanorma-linux
path: build/metanorma
name: metanorma-tebako-linux
path: ${{ env.TEBAKO_DIR }}/build/metanorma

- name: run 'metanorma help'
run: ${{ env.TEBAKO_DIR }}/build/metanorma help

- name: run 'metanorma version'
run: ${{ env.TEBAKO_DIR }}/build/metanorma version

- name: run 'metanorma list-doctypes'
run: ${{ env.TEBAKO_DIR }}/build/metanorma list-doctypes

- name: run 'metanorma list-extensions'
run: ${{ env.TEBAKO_DIR }}/build/metanorma list-extensions

- name: Checkout metanorma/iso-19156
uses: actions/checkout@v2
with:
repository: metanorma/iso-19156
path: iso-19156
fetch-depth: 1

- name: Generate iso-19156
run: |
cd iso-19156
${{ env.TEBAKO_DIR }}/build/metanorma site generate
- name: prepare cache
if: steps.cache.outputs.cache-hit != 'true'
run: |
rm -rf ${{ env.TEBAKO_DIR }}/${{ env.DEPS }}/src/_ruby*
pushd ${{ env.TEBAKO_DIR }}
bin/tebako setup
popd
test:
needs: build
Expand Down Expand Up @@ -91,10 +186,11 @@ jobs:

- uses: actions/download-artifact@v2
with:
name: metanorma-linux
name: metanorma-tebako-linux
path: build

- run: chmod +x build/metanorma
- run: |
chmod +x build/metanorma
- name: Test processing for ${{ matrix.test-flavor }}
timeout-minutes: 45
Expand All @@ -110,12 +206,12 @@ jobs:

release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/download-artifact@v2
with:
name: metanorma-linux
name: metanorma-tebako-linux
path: build

- name: Set release binary permissions
Expand All @@ -131,9 +227,9 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
repository: metanorma/metanorma-snap
event-type: ${{ github.repository }}
client-payload: '{ "ref": "${{ github.ref }}" }'
# - uses: peter-evans/repository-dispatch@v1
# with:
# token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
# repository: metanorma/metanorma-snap
# event-type: ${{ github.repository }}
# client-payload: '{ "ref": "${{ github.ref }}" }'

0 comments on commit 9ccf8c6

Please sign in to comment.