schedule:
- cron: 0 7 1 * *
jobs:
- build:
+ build-linux:
+ runs-on: ubuntu-latest
strategy:
matrix:
- os:
- - ubuntu-latest
config-args:
- "--with-embedded-libevent"
- "--disable-shared --enable-static"
release:
- false
include:
- - os: ubuntu-latest
- config-args: ''
+ - config-args: ''
release: true
- - os: ubuntu-latest
- compiler: clang
+ - compiler: clang
config-args: "--with-snmp --with-xml"
- - os: macos-latest
- compiler: clang
- config-args: "--with-snmp --with-xml"
- - os: macos-latest
- compiler: clang
- config-args: >
- --prefix=/usr/local
- --localstatedir=/var
- --sysconfdir=/private/etc
- --with-embedded-libevent
- --without-snmp
- --without-xml
- release: true
- runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
LLDPD_CONFIG_ARGS: ${{ matrix.config-args }}
CC: ${{ matrix.compiler }}
- name: Generate release body
- if: matrix.release && matrix.os == 'ubuntu-latest'
+ if: matrix.release
run: ./tests/ci/release.sh > release.md
- name: Upload release tarball
uses: actions/upload-artifact@v2
- if: matrix.release && matrix.os == 'ubuntu-latest'
+ if: matrix.release
with:
name: tarball
path: lldpd-*.tar.gz
if-no-files-found: error
+ - name: Upload release summary
+ uses: actions/upload-artifact@v2
+ if: matrix.release
+ with:
+ name: release
+ path: release.md
+ if-no-files-found: error
+
+ build-macos:
+ runs-on: macos-latest
+ strategy:
+ matrix:
+ include:
+ - config-args: "--with-snmp --with-xml"
+ release: false
+ - config-args: >
+ --prefix=/usr/local
+ --localstatedir=/var
+ --sysconfdir=/private/etc
+ --with-embedded-libevent
+ --without-snmp
+ --without-xml
+ release: true
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: true
+ - name: Install stuff
+ run: ./tests/ci/install.sh
+ - name: Build and run tests
+ run: ./tests/ci/run.sh
+ env:
+ LLDPD_CONFIG_ARGS: ${{ matrix.config-args }}
+ CC: clang
- name: Upload MacOS release package
uses: actions/upload-artifact@v2
- if: matrix.release && matrix.os == 'macos-latest'
+ if: matrix.release
with:
name: package
path: lldpd-*.pkg
if-no-files-found: error
- - name: Upload release summary
- uses: actions/upload-artifact@v2
- if: matrix.release && matrix.os == 'ubuntu-latest'
+
+ build-bsd:
+ timeout-minutes: 20
+ strategy:
+ fail-fast: false
+ matrix:
+ os:
+ - name: freebsd
+ version: '13.0'
+ runner: macos-10.15
+ - name: openbsd
+ version: '6.9'
+ runner: macos-10.15
+ runs-on: ${{ matrix.os.runner }}
+ steps:
+ - uses: actions/checkout@v2
with:
- name: release
- path: release.md
- if-no-files-found: error
+ submodules: true
+ - name: Test on ${{ matrix.os.name }}
+ uses: cross-platform-actions/action@v0.3.1
+ with:
+ operating_system: ${{ matrix.os.name }}
+ version: ${{ matrix.os.version }}
+ environment_variables: LLDPD_CONFIG_ARGS
+ shell: bash
+ run: |
+ set -e
+ ./tests/ci/install.sh
+ ./tests/ci/run.sh
docker:
- needs: build
+ needs:
+ - build-linux
+ - build-macos
+ - build-bsd
runs-on: ubuntu-latest
name: Build Docker images
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
labels: ${{ steps.meta.outputs.labels }}
release:
- needs: build
+ needs:
+ - build-linux
+ - build-macos
+ - build-bsd
runs-on: ubuntu-latest
name: Publish release
if: startsWith(github.ref, 'refs/tags/')
atom-glue.c: $(ATOM_FILES) Makefile
$(AM_V_GEN)(for f in $(ATOM_FILES:%=$(srcdir)/%); do \
- $(CC) -E $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $$f; done | \
$(SED) -n 's+^void init_atom_builder_\([^(]*\)().*, \([0-9]*\)).*+\2 \1+p' | \
sort | \
for (atom in atoms) { print " init_atom_builder_"atom"();" } \
print "}"; }' && \
for f in $(ATOM_FILES:%=$(srcdir)/%); do \
- $(CC) -E $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $$f; done | \
$(SED) -n 's+^void init_atom_map_\([^(]*\)().*, \([0-9]*\)).*+\2 \1+p' | \
sort -n | \
set -e
case "$(uname -s)" in
+ OpenBSD)
+ sudo pkg_add -I \
+ automake-1.16.3 autoconf-2.71 libtool \
+ libevent libxml check \
+ git
+ ;;
+ FreeBSD)
+ sudo env ASSUME_ALWAYS_YES=true pkg install \
+ automake autoconf libtool pkgconf \
+ libevent libxml2 check \
+ git
+ ;;
+ NetBSD)
+ sudo pkgin -y update
+ sudo pkgin -y install \
+ automake autoconf libtool pkg-config \
+ libevent libxml2 check \
+ git
+ ;;
Darwin)
brew update > /dev/null
brew bundle --file=- <<-EOS