Skip to content

Napi

Napi #1978

Workflow file for this run

# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2025 Robin Jarry
---
name: Package
permissions:
contents: read
on:
workflow_call:
pull_request:
branches:
- main
jobs:
deb:
if: ${{ github.actor != 'grout-bot' }}
permissions:
actions: write
runs-on: ubuntu-24.04
container: "debian:stable"
steps:
- name: install system dependencies
run: |
set -xe
apt-get update -qy
apt-get install -qy --no-install-recommends \
bash-completion \
build-essential \
ccache \
curl \
debhelper \
devscripts \
git \
libarchive-dev \
libcmocka-dev \
libedit-dev \
libevent-dev \
libibverbs-dev \
libmnl-dev \
libnuma-dev \
meson \
ninja-build \
patch \
pkg-config \
python3-pyelftools \
scdoc \
systemd-dev
- uses: actions/checkout@v6
with:
fetch-depth: 0 # force fetch all history
persist-credentials: false
- run: git config --global --add safe.directory $PWD
- run: git fetch --force origin 'refs/tags/v*:refs/tags/v*'
- run: echo "CCACHE_DIR=$(ccache -k cache_dir)" >> $GITHUB_ENV
- uses: actions/cache/restore@v5
id: cache
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-x86_64-deb
- run: ccache -z
- run: make deb CC="ccache gcc" DEB_BUILD_OPTIONS=nofrr
- run: ccache -sv
- name: delete old cache
if: ${{ ! github.event.pull_request }}
uses: actions/github-script@v9
with:
script: |
try {
await github.rest.actions.deleteActionsCacheByKey({
owner: context.repo.owner,
repo: context.repo.repo,
key: "${{ steps.cache.outputs.cache-primary-key }}"
});
} catch (error) {
if (error.status !== 404) throw error;
}
- uses: actions/cache/save@v5
if: ${{ ! github.event.pull_request }}
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ steps.cache.outputs.cache-primary-key }}
- uses: actions/upload-artifact@v7
with:
name: deb-packages
path: '*.deb'
retention-days: 5
rpm:
if: ${{ github.actor != 'grout-bot' }}
permissions:
actions: write
strategy:
matrix:
arch: [x86_64, aarch64]
runs-on: ubuntu-24.04${{ matrix.arch == 'aarch64' && '-arm' || '' }}
container: "quay.io/centos/centos:stream10"
steps:
- name: install system dependencies
run: |
set -xe
dnf install -y epel-release
dnf --enablerepo=crb install -y --nodocs --setopt=install_weak_deps=0 \
autoconf \
automake \
bison \
ccache \
elfutils-libelf-devel \
flex \
gcc \
git \
groff \
json-c-devel \
libarchive-devel \
libcap-devel \
libcmocka-devel \
libedit-devel \
libevent-devel \
libmnl-devel \
libtool \
libyang-devel \
make \
meson \
ninja-build \
numactl-devel \
pam-devel \
pkgconf \
protobuf-c-compiler \
protobuf-c-devel \
python3-devel \
python3-pyelftools \
rdma-core-devel \
readline-devel \
rpm-build \
scdoc \
systemd \
systemd-devel
- uses: actions/checkout@v6
with:
fetch-depth: 0 # force fetch all history
persist-credentials: false
- run: git config --global --add safe.directory $PWD
- run: git fetch --force origin 'refs/tags/v*:refs/tags/v*'
- run: echo "CCACHE_DIR=$(ccache -k cache_dir)" >> $GITHUB_ENV
- uses: actions/cache/restore@v5
id: cache
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ matrix.arch }}-rpm
- run: ccache -z
- run: make frr-rpm CC="ccache gcc"
- run: dnf install -y --nodocs --setopt=install_weak_deps=0 ./frr-headers.noarch.rpm
- run: make rpm CC="ccache gcc" WITH=download
- run: ccache -sv
- name: delete old cache
if: ${{ ! github.event.pull_request }}
uses: actions/github-script@v9
with:
script: |
try {
await github.rest.actions.deleteActionsCacheByKey({
owner: context.repo.owner,
repo: context.repo.repo,
key: "${{ steps.cache.outputs.cache-primary-key }}"
});
} catch (error) {
if (error.status !== 404) throw error;
}
- uses: actions/cache/save@v5
if: ${{ ! github.event.pull_request }}
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ steps.cache.outputs.cache-primary-key }}
- uses: actions/upload-artifact@v7
with:
name: rpm-${{ matrix.arch }}-packages
path: "*.rpm"
retention-days: 5