Skip to content

Commit

Permalink
adding CI job to build static libs on amd64/arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
miki725 committed Sep 18, 2023
1 parent 0fc4325 commit 749af95
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/Dockerfile.staticlibs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM ghcr.io/crashappsec/nim:ubuntu-2.0.0 as nim

# https://github.com/actions/runner/issues/2033
RUN if which git; then git config --global --add safe.directory "*"; fi

# deps for compiling static deps
RUN apt-get update -y && \
apt-get install -y \
autoconf \
cmake \
file \
g++ \
gcc \
git \
m4 \
make \
&& \
apt-get clean -y

WORKDIR /con4m
9 changes: 9 additions & 0 deletions .github/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
services:
staticlibs:
build:
context: ..
dockerfile: .github/Dockerfile.staticlibs
working_dir: /con4m
volumes:
- ..:/con4m
- $HOME/.local/c0:/root/.local/c0
51 changes: 51 additions & 0 deletions .github/workflows/staticlibs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: staticlibs

on:
workflow_dispatch:
inputs:

jobs:
buildlibs:
runs-on: ${{ matrix.builder }}

strategy:
matrix:
include:
- builder: ubuntu-latest
arch: amd64
os: linux
- builder: buildjet-2vcpu-ubuntu-2204-arm
arch: arm64
os: linux

steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Show Static Libs
run: |
set -x
ls -la ~/.local/c0/libs/* || true
ls -la files/deps/lib/* || true
- name: Clean up existing libs
run: |
rm -rf files/deps/lib/*
- name: Build Static Libs
working-directory: ./.github
run: |
docker compose run --rm staticlibs nimble build
- name: Show Static Libs
run: |
set -x
ls -la ~/.local/c0/libs/* || true
ls -la files/deps/lib/* || true
- name: Save Artifact
uses: actions/upload-artifact@v3
if: always()
with:
name: ${{ matrix.os }}-${{ matrix.arch }}
path: ~/.local/c0/libs/*

0 comments on commit 749af95

Please sign in to comment.