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

ci: fix Dockerfile and test-in-docker-compose job #1398

Merged
merged 2 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions .github/workflows/build_image_ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,25 +91,34 @@ jobs:
working-directory: devtools/chain

steps:
- uses: actions/checkout@v4
- name: Checkout devtools/chain
uses: actions/checkout@v4
with:
sparse-checkout: |
devtools/chain
devtools/ci/scripts/helper.js

- name: Modify Axon image
- name: Modify the Axon image of in devtools/chain/docker-compose.yml
env:
AXON_IMAGE: "${{ needs.build-amd64-image-to-ghcr.outputs.image_name }}:${{ needs.build-amd64-image-to-ghcr.outputs.image_tag }}"
uses: mikefarah/yq@v4
uses: mikefarah/yq@v4.35.1
with:
cmd: |
echo "Update the image of Axon"
yq -i '.services.axon.image = "${{ env.AXON_IMAGE }}"' ./docker-compose.yml
echo "====== devtools/chain/docker-compose.yml ======"
cat docker-compose.yml
cmd: yq -i '.services.axon.image = "${{ env.AXON_IMAGE }}"' 'devtools/chain/docker-compose.yml'

- name: Review devtools/chain/docker-compose.yml
run: |
echo "====== devtools/chain/docker-compose.yml ======\n"
cat docker-compose.yml
echo "===============================================\n"

- name: Run docker compose up and a simple test
run: |
docker-compose up -d
docker-compose ps
docker-compose logs --tail 6

echo "TODO: health_check" && sleep 6
KaoImin marked this conversation as resolved.
Show resolved Hide resolved

npx zx <<'EOF'
import { waitXBlocksPassed } from '../ci/scripts/helper.js'
await waitXBlocksPassed('http://127.0.0.1:8000', 2);
Expand Down
12 changes: 4 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,10 @@ RUN cd /build && cargo build --release
FROM debian:bookworm-20230612-slim
WORKDIR /app

RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
libssl-dev \
libc6-dev \
ca-certificates; \
rm -rf /var/lib/apt/lists/*

COPY --from=builder \
/usr/lib/x86_64-linux-gnu/libssl.so.* \
/usr/lib/x86_64-linux-gnu/libcrypto.so.* \
/usr/lib/x86_64-linux-gnu/
COPY --from=builder /build/target/release/axon /app/axon
COPY --from=builder /build/devtools /app/devtools

Expand Down
2 changes: 0 additions & 2 deletions devtools/chain/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ services:
ports:
- 8000:8000
- 127.0.0.1:8100:8100
volumes:
- ./:/app/devtools/chain
networks:
- axon-net
restart: unless-stopped
Expand Down