Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding testing workflow for libabigail #10

Merged
merged 14 commits into from
Apr 22, 2022
Merged
34 changes: 34 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test Libabigail

on:
pull_request: []
push:
branches:
- master

jobs:
build:
permissions:
packages: read
strategy:
fail-fast: false
matrix:

# Testing containers (build and run make check)
dockerfile: ["Dockerfile.test"]

runs-on: ubuntu-latest
name: Build
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Make Space For Build
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc

- name: Build Test Container
env:
dockerfile: ${{ matrix.dockerfile }}
run: docker build -f docker/${dockerfile} -t libabigail-test .
9 changes: 9 additions & 0 deletions README-DOCKER.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,12 @@ bin include lib share
```

Note that the fedora container does not come with spack.

### Testing

We provide a testing container, which will use a fedora base and add new code to
compile, and then run `make check`. You can do this as follows on your local machine:

```bash
$ docker build -f docker/Dockerfile.test -t test .
```
29 changes: 11 additions & 18 deletions docker/Dockerfile.fedora
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
ARG fedora_version=latest
# ARG fedora_version=35
FROM fedora:${fedora_version} as builder
FROM ghcr.io/woodard/libabigail-fedora-base as builder

# docker build -t ghcr.io/woodard/libabigail .

RUN dnf install -y \
autoconf \
automake \
cpio \
elfutils-devel \
gcc-c++ \
libtool \
libxml2-devel \
python3-koji \
python3-mock \
python3-pyxdg \
six \
wget
# docker build -f docker/Dockerfile.fedora -t ghcr.io/woodard/libabigail-fedora .

WORKDIR /code
COPY . /code
Expand All @@ -40,3 +24,12 @@ RUN mkdir -p build && \
FROM fedora:latest
COPY --from=builder /opt/libabigail /opt/libabigail
ENV PATH=/opt/libabigail/bin:$PATH

# Runtime dependencies
RUN dnf install -y \
libxml2-devel \
vsoch marked this conversation as resolved.
Show resolved Hide resolved
libxml2-libs \
python3-koji \
python3-mock \
python3-pyxdg \
six
4 changes: 4 additions & 0 deletions docker/Dockerfile.fedora-base
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ RUN dnf install -y \
automake \
cpio \
elfutils-devel \
elfutils-libs \
vsoch marked this conversation as resolved.
Show resolved Hide resolved
gcc-c++ \
libtool \
libxml2-libs \
vsoch marked this conversation as resolved.
Show resolved Hide resolved
libxml2-devel \
python3-koji \
python3-mock \
python3-pyxdg \
six \
file \
vsoch marked this conversation as resolved.
Show resolved Hide resolved
diffutils \
wget
28 changes: 28 additions & 0 deletions docker/Dockerfile.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM ghcr.io/woodard/libabigail-fedora-base

# docker build -f docker/Dockerfile.test -t test .

RUN dnf install -y \
file \
diffutils \
elfutils-libs \
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that these shouldn't be necessary here because we have the devel packages in the build environment. I may have lost the control logic though. If they are needed here then there are a few more runtime libs needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would have only elfutils-libs in the fedora base container, but not the other two (since we are removing them). I'm adding them all here because we haven't built -> deployed the base container with these changes yet.

libxml2-libs

WORKDIR /code
COPY . /code

RUN mkdir -p build && \
autoreconf -i && \
cd build && \
CXXFLAGS="-g3 -fvar-tracking-assignments \
-gstatement-frontiers -gvariable-location-views -grecord-gcc-switches -pipe -Wall \
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -Wp,-D_GLIBCXX_ASSERTIONS \
-fstack-protector-strong -fstack-clash-protection -fcf-protection \
-fasynchronous-unwind-tables -O2" CFLAGS="-g3 -fvar-tracking-assignments \
-gstatement-frontiers -gvariable-location-views -grecord-gcc-switches -pipe -Wall \
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -Wp,-D_GLIBCXX_ASSERTIONS \
-fstack-protector-strong -fstack-clash-protection -fcf-protection \
-fasynchronous-unwind-tables -O2" LDFLAGS="-Wl,--no-undefined" \
../configure --prefix=/opt/libabigail --enable-rpm=yes && \
make -j4 && \
make check