Skip to content

Commit

Permalink
chore: Use docker for the autotools ci build.
Browse files Browse the repository at this point in the history
This makes it easier to run it locally for testing and ensures the
dockerfile continues to work.
  • Loading branch information
iphydf committed Dec 14, 2021
1 parent 064ec83 commit 5c1796d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 31 deletions.
1 change: 1 addition & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ branches:
protection:
required_status_checks:
contexts:
- build-nacl
- Codacy Static Code Analysis
- CodeFactor
- "ci/circleci: asan"
Expand Down
21 changes: 6 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,9 @@ jobs:
build-nacl:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run:
sudo apt-get update &&
sudo apt-get install -y --no-install-recommends
libconfig-dev
libopus-dev
libvpx-dev
pkg-config

- name: Build NaCl
run: .travis/autotools-linux install

- name: Build toxcore
run: CC=gcc .travis/autotools-linux script
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Docker Build
uses: docker/build-push-action@v2
with:
file: other/docker/autotools/Dockerfile
8 changes: 0 additions & 8 deletions auto_tests/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ endif

check_PROGRAMS = $(TESTS)

bootstrap_test_SOURCES = ../auto_tests/bootstrap_test.c
bootstrap_test_CFLAGS = $(AUTOTEST_CFLAGS)
bootstrap_test_LDADD = $(AUTOTEST_LDADD)

conference_double_invite_test_SOURCES = ../auto_tests/conference_double_invite_test.c
conference_double_invite_test_CFLAGS = $(AUTOTEST_CFLAGS)
conference_double_invite_test_LDADD = $(AUTOTEST_LDADD)
Expand Down Expand Up @@ -190,10 +186,6 @@ skeleton_test_SOURCES = ../auto_tests/skeleton_test.c
skeleton_test_CFLAGS = $(AUTOTEST_CFLAGS)
skeleton_test_LDADD = $(AUTOTEST_LDADD)

tcp_relay_test_SOURCES = ../auto_tests/tcp_relay_test.c
tcp_relay_test_CFLAGS = $(AUTOTEST_CFLAGS)
tcp_relay_test_LDADD = $(AUTOTEST_LDADD)

TCP_test_SOURCES = ../auto_tests/TCP_test.c
TCP_test_CFLAGS = $(AUTOTEST_CFLAGS)
TCP_test_LDADD = $(AUTOTEST_LDADD)
Expand Down
25 changes: 17 additions & 8 deletions other/docker/autotools/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
################################################
# autotools-linux
FROM localbuild/travis:1.0.0
FROM ubuntu:20.04

USER root
RUN apt-get update && apt-get install --no-install-recommends -y \
autoconf \
automake \
ca-certificates \
curl \
libconfig-dev \
libopus-dev \
libtool \
libvpx-dev \
make \
pkg-config \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
USER travis

RUN groupadd -r -g 1000 builder \
&& useradd -m --no-log-init -r -g builder -u 1000 builder
USER builder

# Copy minimal files to run "autotools-linux install", so we can avoid
# rebuilding nacl and other things when only source files change.
RUN mkdir -p /home/travis/build/c-toxcore /home/travis/cache
WORKDIR /home/travis/build/c-toxcore
COPY --chown=travis:travis c-toxcore/.travis/ /home/travis/build/c-toxcore/.travis/
RUN mkdir -p /home/builder/build/c-toxcore /home/builder/cache
WORKDIR /home/builder/build/c-toxcore
COPY --chown=builder:builder .travis/ /home/builder/build/c-toxcore/.travis/
RUN .travis/autotools-linux install

# Now copy the rest of the sources and run the build.
COPY --chown=travis:travis . /home/travis/build/
RUN .travis/autotools-linux script
COPY --chown=builder:builder . /home/builder/build/c-toxcore/
RUN CC=gcc .travis/autotools-linux script

0 comments on commit 5c1796d

Please sign in to comment.