Skip to content

Commit

Permalink
Merge branch 'main' of github.com:AntelopeIO/leap into gh-17
Browse files Browse the repository at this point in the history
  • Loading branch information
greg7mdp committed Jul 26, 2023
2 parents 70442b3 + ee027a7 commit 513d510
Show file tree
Hide file tree
Showing 76 changed files with 1,741 additions and 810 deletions.
3 changes: 2 additions & 1 deletion .cicd/platforms/ubuntu20.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ RUN apt-get update && apt-get upgrade -y && \
cmake \
git \
jq \
libboost-all-dev \
libcurl4-openssl-dev \
libgmp-dev \
libssl-dev \
llvm-11-dev \
ninja-build \
python3-numpy \
file \
zlib1g-dev \
zstd
3 changes: 2 additions & 1 deletion .cicd/platforms/ubuntu22.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ RUN apt-get update && apt-get upgrade -y && \
cmake \
git \
jq \
libboost-all-dev \
libcurl4-openssl-dev \
libgmp-dev \
libssl-dev \
llvm-11-dev \
ninja-build \
python3-numpy \
file \
zlib1g-dev \
zstd
120 changes: 33 additions & 87 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,13 @@ defaults:
shell: bash

jobs:
d:
name: Discover Platforms
runs-on: ubuntu-latest
outputs:
missing-platforms: ${{steps.discover.outputs.missing-platforms}}
p: ${{steps.discover.outputs.platforms}}
steps:
- name: Discover Platforms
id: discover
uses: AntelopeIO/discover-platforms-action@v1
with:
platform-file: .cicd/platforms.json
password: ${{secrets.GITHUB_TOKEN}}
package-name: builders
build-base:
name: Run Build Workflow
uses: ./.github/workflows/build_base.yaml
permissions:
packages: write
contents: read

v:
name: Discover Versions
runs-on: ubuntu-latest
Expand Down Expand Up @@ -72,73 +65,21 @@ jobs:
if [[ "${{inputs.override-eos-system-contracts}}" != "" ]]; then
echo eos-system-contracts-ref=${{inputs.override-eos-system-contracts}} >> $GITHUB_OUTPUT
fi
build-platforms:
name: Build Platforms
needs: d
if: needs.d.outputs.missing-platforms != '[]'
strategy:
fail-fast: false
matrix:
platform: ${{fromJSON(needs.d.outputs.missing-platforms)}}
runs-on: ["self-hosted", "enf-x86-beefy"]
permissions:
packages: write
contents: read
steps:
- name: Login to Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{github.repository_owner}}
password: ${{secrets.GITHUB_TOKEN}}
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}}
file: ${{fromJSON(needs.d.outputs.p)[matrix.platform].dockerfile}}

Build:
needs: [d, build-platforms]
if: always() && needs.d.result == 'success' && (needs.build-platforms.result == 'success' || needs.build-platforms.result == 'skipped')
strategy:
fail-fast: false
matrix:
platform: [ubuntu20, ubuntu22]
runs-on: ["self-hosted", "enf-x86-beefy"]
container: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Build
id: build
run: |
# https://github.com/actions/runner/issues/2033
chown -R $(id -u):$(id -g) $PWD
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -GNinja
cmake --build build
tar -pc --exclude "*.o" build | zstd --long -T0 -9 > build.tar.zst
- name: Upload builddir
uses: AntelopeIO/upload-artifact-large-chunks-action@v1
with:
name: ${{matrix.platform}}-build
path: build.tar.zst
dev-package:
name: Build leap-dev package
needs: [d, Build]
if: always() && needs.Build.result == 'success'
needs: [build-base]
if: always() && needs.build-base.result == 'success'
strategy:
fail-fast: false
matrix:
platform: [ubuntu20, ubuntu22]
runs-on: ubuntu-latest
container: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}}
container: ${{fromJSON(needs.build-base.outputs.p)[matrix.platform].image}}
steps:
- uses: actions/checkout@v3
with:
submodules: true
submodules: recursive
- name: Download builddir
uses: actions/download-artifact@v3
with:
Expand All @@ -150,8 +91,8 @@ jobs:
cpack
- name: Install dev package
run: |
apt update && apt upgrade -y
apt install -y ./build/leap_*.deb ./build/leap-dev*.deb
apt-get update && apt-get upgrade -y
apt-get install -y ./build/leap_*.deb ./build/leap-dev*.deb
- name: Test using TestHarness
run: |
python3 -c "from TestHarness import Cluster"
Expand All @@ -163,15 +104,15 @@ jobs:

tests:
name: Tests
needs: [d, Build]
if: always() && needs.Build.result == 'success'
needs: [build-base]
if: always() && needs.build-base.result == 'success'
strategy:
fail-fast: false
matrix:
platform: [ubuntu20, ubuntu22]
runs-on: ["self-hosted", "enf-x86-hightier"]
container:
image: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}}
image: ${{fromJSON(needs.build-base.outputs.p)[matrix.platform].image}}
options: --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v3
Expand All @@ -189,8 +130,8 @@ jobs:
np-tests:
name: NP Tests
needs: [d, Build]
if: always() && needs.Build.result == 'success'
needs: [build-base]
if: always() && needs.build-base.result == 'success'
strategy:
fail-fast: false
matrix:
Expand All @@ -205,7 +146,7 @@ jobs:
- name: Run tests in parallel containers
uses: ./.github/actions/parallel-ctest-containers
with:
container: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}}
container: ${{fromJSON(needs.build-base.outputs.p)[matrix.platform].image}}
error-log-paths: '["build/etc", "build/var", "build/leap-ignition-wd", "build/TestLogs"]'
log-tarball-prefix: ${{matrix.platform}}
tests-label: nonparallelizable_tests
Expand All @@ -219,8 +160,8 @@ jobs:

lr-tests:
name: LR Tests
needs: [d, Build]
if: always() && needs.Build.result == 'success'
needs: [build-base]
if: always() && needs.build-base.result == 'success'
strategy:
fail-fast: false
matrix:
Expand All @@ -235,7 +176,7 @@ jobs:
- name: Run tests in parallel containers
uses: ./.github/actions/parallel-ctest-containers
with:
container: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}}
container: ${{fromJSON(needs.build-base.outputs.p)[matrix.platform].image}}
error-log-paths: '["build/etc", "build/var", "build/leap-ignition-wd", "build/TestLogs"]'
log-tarball-prefix: ${{matrix.platform}}
tests-label: long_running_tests
Expand All @@ -249,16 +190,24 @@ jobs:

libtester-tests:
name: libtester tests
needs: [d, v, Build, dev-package]
needs: [build-base, v, dev-package]
if: always() && needs.v.result == 'success' && needs.dev-package.result == 'success'
strategy:
fail-fast: false
matrix:
platform: [ubuntu20, ubuntu22]
test: [build-tree, make-dev-install, deb-install]
runs-on: ["self-hosted", "enf-x86-midtier"]
container: ${{ matrix.test != 'deb-install' && fromJSON(needs.d.outputs.p)[matrix.platform].image || matrix.platform == 'ubuntu20' && 'ubuntu:focal' || 'ubuntu:jammy' }}
container: ${{ matrix.test != 'deb-install' && fromJSON(needs.build-base.outputs.p)[matrix.platform].image || matrix.platform == 'ubuntu20' && 'ubuntu:focal' || 'ubuntu:jammy' }}
env:
DEBIAN_FRONTEND: noninteractive
TZ: Etc/UTC
steps:
- name: Update Package Index & Upgrade Packages
run: |
apt-get update
apt-get upgrade -y
# LEAP
- if: ${{ matrix.test != 'deb-install' }}
name: Clone leap
Expand Down Expand Up @@ -295,9 +244,6 @@ jobs:
- if: ${{ matrix.test == 'deb-install' }}
name: Install leap-dev Package
run: |
apt-get update
export DEBIAN_FRONTEND='noninteractive'
export TZ='Etc/UTC'
apt-get install -y ./*.deb
rm ./*.deb
Expand All @@ -314,7 +260,7 @@ jobs:
token: ${{github.token}}
- name: Install cdt Packages
run: |
apt install -y ./*.deb
apt-get install -y ./*.deb
rm ./*.deb
# Reference Contracts
Expand Down
87 changes: 87 additions & 0 deletions .github/workflows/build_base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: "Build leap"

on:
workflow_dispatch:
workflow_call:
outputs:
p:
description: "Discovered Build Platforms"
value: ${{ jobs.d.outputs.p }}

permissions:
packages: read
contents: read

defaults:
run:
shell: bash

jobs:
d:
name: Discover Platforms
runs-on: ubuntu-latest
outputs:
missing-platforms: ${{steps.discover.outputs.missing-platforms}}
p: ${{steps.discover.outputs.platforms}}
steps:
- name: Discover Platforms
id: discover
uses: AntelopeIO/discover-platforms-action@v1
with:
platform-file: .cicd/platforms.json
password: ${{secrets.GITHUB_TOKEN}}
package-name: builders

build-platforms:
name: Build Platforms
needs: d
if: needs.d.outputs.missing-platforms != '[]'
strategy:
fail-fast: false
matrix:
platform: ${{fromJSON(needs.d.outputs.missing-platforms)}}
runs-on: ["self-hosted", "enf-x86-beefy"]
permissions:
packages: write
contents: read
steps:
- name: Login to Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{github.repository_owner}}
password: ${{secrets.GITHUB_TOKEN}}
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}}
file: ${{fromJSON(needs.d.outputs.p)[matrix.platform].dockerfile}}

Build:
name: Build leap
needs: [d, build-platforms]
if: always() && needs.d.result == 'success' && (needs.build-platforms.result == 'success' || needs.build-platforms.result == 'skipped')
strategy:
fail-fast: false
matrix:
platform: [ubuntu20, ubuntu22]
runs-on: ["self-hosted", "enf-x86-beefy"]
container: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Build
id: build
run: |
# https://github.com/actions/runner/issues/2033
chown -R $(id -u):$(id -g) $PWD
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_LEAP_DEV_DEB=On -GNinja
cmake --build build
tar -pc --exclude "*.o" build | zstd --long -T0 -9 > build.tar.zst
- name: Upload builddir
uses: AntelopeIO/upload-artifact-large-chunks-action@v1
with:
name: ${{matrix.platform}}-build
path: build.tar.zst
Loading

0 comments on commit 513d510

Please sign in to comment.