Skip to content

Commit bca32e8

Browse files
ci: remove tests on Docker image + small improvements
1 parent b3ba779 commit bca32e8

File tree

3 files changed

+11
-42
lines changed

3 files changed

+11
-42
lines changed

.github/workflows/_build-and-merge-docker.yml

Lines changed: 6 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ on:
99
distro:
1010
required: true
1111
type: string
12-
with_datadog:
12+
with_datadog_profiling:
1313
required: true
1414
type: boolean
1515

1616
# Adapted from https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners
1717
jobs:
1818
build-docker:
19-
name: Build Docker image for ${{ inputs.distro }} on ${{ matrix.platform }} (DD ${{ inputs.with_datadog }})
19+
name: Build Docker image for ${{ inputs.distro }} on ${{ matrix.platform }} (DD ${{ inputs.with_datadog_profiling }})
2020
# We use a custom runner for ARM64 builds.
2121
runs-on: ${{ matrix.platform == 'linux/amd64' && 'ubuntu-22.04' || 'ubuntu-22.04-arm' }}
2222
strategy:
@@ -31,15 +31,6 @@ jobs:
3131
env:
3232
DATABASE_URL: postgresql://postgres:postgres@localhost/nittei
3333

34-
services:
35-
postgres:
36-
image: postgres:13
37-
env:
38-
POSTGRES_PASSWORD: postgres
39-
POSTGRES_DB: nittei
40-
ports:
41-
- 5432:5432
42-
4334
steps:
4435
- name: Prepare
4536
run: |
@@ -74,35 +65,13 @@ jobs:
7465
id: build
7566
uses: docker/build-push-action@v6
7667
with:
77-
file: "./${{ inputs.distro }}${{ inputs.with_datadog && 'WithDD' || '' }}.Dockerfile"
68+
file: "./${{ inputs.distro }}${{ inputs.with_datadog_profiling && 'WithDD' || '' }}.Dockerfile"
7869
platforms: ${{ matrix.platform }}
79-
# This is for the Alpine image
70+
# Handle the correct arch
8071
build-args: |
8172
ARCH=${{ matrix.platform == 'linux/amd64' && 'x86_64' || 'aarch64' }}
82-
labels: ${{ steps.meta.outputs.labels }}
8373
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
8474

85-
- name: Test image
86-
run: |
87-
88-
# Test the image by running a container from it, linking to the host network, and running the JS tests
89-
docker run --rm -e DATABASE_URL=$DATABASE_URL -e NITTEI__HTTP_PORT=5000 -e NITTEI__DATABASE_URL=$DATABASE_URL -p 5000:5000 --network host --name nittei-test ${{ steps.build.outputs.image }}
90-
91-
# Wait for the server to start
92-
sleep 5
93-
94-
- name: Run tests
95-
run: |
96-
97-
# Run the tests
98-
cd clients/javascript
99-
pnpm i
100-
pnpm run test
101-
102-
- name: Stop test container
103-
run: |
104-
docker stop nittei-test
105-
10675
- name: Export digest
10776
run: |
10877
mkdir -p /tmp/digests
@@ -153,13 +122,13 @@ jobs:
153122
# For alpine with DD: alpine-dd-latest, alpine-dd, alpine-dd-1.0.0
154123
155124
if [[ "${{ inputs.distro }}" == "debian" ]]; then
156-
if [[ "${{ inputs.with_datadog }}" == "true" ]]; then
125+
if [[ "${{ inputs.with_datadog_profiling }}" == "true" ]]; then
157126
echo "TAGS=dd-latest, debian-dd, dd-${{ env.VERSION }}" >> $GITHUB_ENV
158127
else
159128
echo "TAGS=latest, debian, ${{ env.VERSION }}" >> $GITHUB_ENV
160129
fi
161130
elif [[ "${{ inputs.distro }}" == "alpine" ]]; then
162-
if [[ "${{ inputs.with_datadog }}" == "true" ]]; then
131+
if [[ "${{ inputs.with_datadog_profiling }}" == "true" ]]; then
163132
echo "TAGS=alpine-dd-latest, alpine-dd, alpine-dd-${{ env.VERSION }}" >> $GITHUB_ENV
164133
else
165134
echo "TAGS=alpine-latest, alpine, alpine-${{ env.VERSION }}" >> $GITHUB_ENV

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,28 @@ jobs:
1515
uses: ./.github/workflows/_build-and-merge-docker.yml
1616
with:
1717
distro: debian
18-
with_datadog: false
18+
with_datadog_profiling: false
1919
secrets: inherit
2020

2121
alpine-build-and-merge-docker:
2222
uses: ./.github/workflows/_build-and-merge-docker.yml
2323
with:
2424
distro: alpine
25-
with_datadog: false
25+
with_datadog_profiling: false
2626
secrets: inherit
2727

2828
debian-dd-build-and-merge-docker:
2929
uses: ./.github/workflows/_build-and-merge-docker.yml
3030
with:
3131
distro: debian
32-
with_datadog: true
32+
with_datadog_profiling: true
3333
secrets: inherit
3434

3535
alpine-dd-build-and-merge-docker:
3636
uses: ./.github/workflows/_build-and-merge-docker.yml
3737
with:
3838
distro: alpine
39-
with_datadog: true
39+
with_datadog_profiling: true
4040
secrets: inherit
4141

4242
# We don't use the Rust client for now

alpine.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ ENV APP_NAME=${APP_NAME}
3232

3333
COPY --from=builder /${APP_NAME} /${APP_NAME}
3434

35-
CMD /${APP_NAME}
35+
CMD ["/bin/sh", "-c", "exec /${APP_NAME}"]

0 commit comments

Comments
 (0)