Skip to content

Commit

Permalink
Merge pull request #12248 from tomponline/tp-dist
Browse files Browse the repository at this point in the history
tests: Test the distribution tarball can be used to build LXD and its dependencies
  • Loading branch information
tomponline authored Sep 13, 2023
2 parents f9db8d5 + 9134751 commit 5f98389
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ concurrency:

jobs:
code-tests:
env:
CGO_CFLAGS: "-I/home/runner/work/lxd/lxd-test/vendor/raft/include/ -I/home/runner/work/lxd/lxd-test/vendor/dqlite/include/"
CGO_LDFLAGS: "-L/home/runner/work/lxd/lxd-test/vendor/raft/.libs/ -L/home/runner/work/lxd/lxd-test/vendor/dqlite/.libs/"
LD_LIBRARY_PATH: "/home/runner/work/lxd/lxd-test/vendor/raft/.libs/:/home/runner/work/lxd/lxd-test/vendor/dqlite/.libs/"
CGO_LDFLAGS_ALLOW: "(-Wl,-wrap,pthread_create)|(-Wl,-z,now)"
name: Code tests
runs-on: ubuntu-22.04
steps:
Expand All @@ -30,24 +35,24 @@ jobs:
- name: Install dependencies
run: |
sudo add-apt-repository ppa:ubuntu-lxc/lxc-git-master -y --no-update
sudo add-apt-repository ppa:dqlite/dev -y --no-update
sudo apt-get update
sudo apt-get install --no-install-recommends -y \
build-essential \
curl \
gettext \
git \
libacl1-dev \
libcap-dev \
libdbus-1-dev \
libdqlite-dev \
liblxc-dev \
lxc-templates \
libseccomp-dev \
libselinux-dev \
libsqlite3-dev \
libtool \
libudev-dev \
libuv1-dev \
make \
pkg-config \
shellcheck
Expand All @@ -58,6 +63,19 @@ jobs:
run: |
go mod download
- name: Make LXD tarball and unpack it
env:
CUSTOM_VERSION: "test"
run: |
make dist
tar -xzf lxd-test.tar.gz -C ~/work/lxd/
rm lxd-test.tar.gz
- name: Build LXD dependencies
run: |
cd ~/work/lxd/lxd-test
make deps
- name: Run LXD build
run: |
make
Expand All @@ -68,7 +86,7 @@ jobs:
- name: Unit tests (all)
run: |
sudo go test ./...
sudo --preserve-env=CGO_CFLAGS,CGO_LDFLAGS,CGO_LDFLAGS_ALLOW,LD_LIBRARY_PATH LD_LIBRARY_PATH=${LD_LIBRARY_PATH} go test ./...
system-tests:
env:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ POFILES=$(wildcard po/*.po)
MOFILES=$(patsubst %.po,%.mo,$(POFILES))
LINGUAS=$(basename $(POFILES))
POTFILE=po/$(DOMAIN).pot
VERSION=$(shell grep "var Version" shared/version/flex.go | cut -d'"' -f2)
VERSION=$(or ${CUSTOM_VERSION},$(shell grep "var Version" shared/version/flex.go | cut -d'"' -f2))
ARCHIVE=lxd-$(VERSION).tar
HASH := \#
TAG_SQLITE3=$(shell printf "$(HASH)include <dqlite.h>\nvoid main(){dqlite_node_id n = 1;}" | $(CC) ${CGO_CFLAGS} -o /dev/null -xc - >/dev/null 2>&1 && echo "libsqlite3")
Expand Down

0 comments on commit 5f98389

Please sign in to comment.