Skip to content

Commit 8a28715

Browse files
committed
Run tests before pushing to docker hub
1 parent cb4ff79 commit 8a28715

1 file changed

Lines changed: 33 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,40 @@ env:
88
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
99

1010
jobs:
11+
test:
12+
name: Test
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Docker Lint
18+
id: docker-lint
19+
run: |
20+
docker run --rm -i ghcr.io/hadolint/hadolint hadolint \
21+
--ignore DL3008 \
22+
--ignore DL3059 \
23+
- < Dockerfile
24+
- name: Run tests
25+
id: smoketest
26+
run: >-
27+
BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
28+
RELEASE=$(cat VERSION)
29+
VERSION=${{ github.sha }}
30+
docker-compose
31+
-f tests/docker-compose.test.mongodb.yml
32+
up
33+
--build
34+
--quiet-pull
35+
--exit-code-from tester
36+
- uses: act10ns/slack@v2
37+
with:
38+
status: ${{ job.status }}
39+
steps: ${{ toJson(steps) }}
40+
if: failure()
41+
1142
push:
1243
name: Docker Push
44+
needs: test
1345
runs-on: ubuntu-latest
1446
if: github.event_name == 'push'
1547

@@ -31,7 +63,7 @@ jobs:
3163
-t $REPOSITORY_URL/$IMAGE_NAME:$(git rev-parse --short HEAD)
3264
-t $REPOSITORY_URL/$IMAGE_NAME:latest .
3365
- name: Docker Login
34-
uses: docker/login-action@v2
66+
uses: docker/login-action@v3
3567
with:
3668
registry: ${{ env.REPOSITORY_URL }}
3769
username: ${{ github.actor }}

0 commit comments

Comments
 (0)