Skip to content

Commit

Permalink
test(node): disable CGO, test Ubuntu 18.04 with apt disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
PhearZero committed Nov 26, 2024
1 parent 26bf8d3 commit 5c26721
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .docker/Fedora.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ WORKDIR /app

ADD . .

RUN go build -cover -o ./bin/algorun *.go
RUN CGO_ENABLED=0 go build -cover -o ./bin/algorun *.go


FROM fedora:39 as legacy
Expand Down
15 changes: 14 additions & 1 deletion .docker/Ubuntu.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,21 @@ WORKDIR /app

ADD . .

RUN go build -cover -o ./bin/algorun *.go
RUN CGO_ENABLED=0 go build -cover -o ./bin/algorun *.go

FROM ubuntu:18.04 as bionic

RUN apt-get update && apt-get install systemd software-properties-common -y && add-apt-repository --yes --update ppa:ansible/ansible

ADD playbook.yaml /root/playbook.yaml
COPY --from=BUILDER /app/bin/algorun /usr/bin/algorun
RUN mkdir -p /app/coverage/int/ubuntu/18.04 && \
echo GOCOVERDIR=/app/coverage/int/ubuntu/18.04 >> /etc/environment && \
apt-get install ansible -y && \
chmod 0 /usr/bin/apt # Liam Neeson

STOPSIGNAL SIGRTMIN+3
CMD ["/bin/systemd"]

FROM ubuntu:22.04 as jammy

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
build:
go build -o bin/algorun *.go
CGO_ENABLED=0 go build -o bin/algorun *.go
test:
go test -coverpkg=./... -covermode=atomic ./...
generate:
Expand Down
65 changes: 37 additions & 28 deletions docker-compose.integration.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
services:
# ubuntu.22.04:
# privileged: true
# environment:
# - GOCOVERDIR=/app/coverage/int/ubuntu/22.04
# build:
# context: .
# target: jammy
# dockerfile: .docker/Ubuntu.dockerfile
# ports:
# - "2222:22"
# volumes:
# - "./coverage/int/ubuntu/22.04:/app/coverage/int/ubuntu/22.04"
# Legacy with apt disabled
ubuntu.18.04:
deploy:
replicas: 0
privileged: true
environment:
- GOCOVERDIR=/app/coverage/int/ubuntu/18.04
build:
context: .
target: bionic
dockerfile: .docker/Ubuntu.dockerfile
volumes:
- "./coverage/int/ubuntu/18.04:/app/coverage/int/ubuntu/18.04"
ubuntu.22.04:
deploy:
replicas: 0
privileged: true
environment:
- GOCOVERDIR=/app/coverage/int/ubuntu/22.04
build:
context: .
target: jammy
dockerfile: .docker/Ubuntu.dockerfile
volumes:
- "./coverage/int/ubuntu/22.04:/app/coverage/int/ubuntu/22.04"
ubuntu.24.04:
privileged: true
environment:
Expand All @@ -19,22 +32,20 @@ services:
context: .
target: noble
dockerfile: .docker/Ubuntu.dockerfile
ports:
- "2223:22"
volumes:
- "./coverage/int/ubuntu/24.04:/app/coverage/int/ubuntu/24.04"
# fedora.39:
# privileged: true
# environment:
# - GOCOVERDIR=/app/coverage/int/fedora/39
# build:
# context: .
# target: legacy
# dockerfile: .docker/Fedora.dockerfile
# ports:
# - "2224:22"
# volumes:
# - "./coverage/int/fedora/39:/app/coverage/int/fedora/39"
fedora.39:
deploy:
replicas: 0
privileged: true
environment:
- GOCOVERDIR=/app/coverage/int/fedora/39
build:
context: .
target: legacy
dockerfile: .docker/Fedora.dockerfile
volumes:
- "./coverage/int/fedora/39:/app/coverage/int/fedora/39"
fedora.40:
privileged: true
environment:
Expand All @@ -43,7 +54,5 @@ services:
context: .
target: previous
dockerfile: .docker/Fedora.dockerfile
ports:
- "2225:22"
volumes:
- "./coverage/int/fedora/40:/app/coverage/int/fedora/40"

0 comments on commit 5c26721

Please sign in to comment.