Skip to content

Commit

Permalink
Run tests before pushing to docker hub
Browse files Browse the repository at this point in the history
  • Loading branch information
satterly committed Apr 9, 2024
1 parent cb4ff79 commit 8a28715
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,40 @@ env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

jobs:
test:
name: Test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Docker Lint
id: docker-lint
run: |
docker run --rm -i ghcr.io/hadolint/hadolint hadolint \
--ignore DL3008 \
--ignore DL3059 \
- < Dockerfile
- name: Run tests
id: smoketest
run: >-
BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
RELEASE=$(cat VERSION)
VERSION=${{ github.sha }}
docker-compose
-f tests/docker-compose.test.mongodb.yml
up
--build
--quiet-pull
--exit-code-from tester
- uses: act10ns/slack@v2
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
if: failure()

push:
name: Docker Push
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push'

Expand All @@ -31,7 +63,7 @@ jobs:
-t $REPOSITORY_URL/$IMAGE_NAME:$(git rev-parse --short HEAD)
-t $REPOSITORY_URL/$IMAGE_NAME:latest .
- name: Docker Login
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REPOSITORY_URL }}
username: ${{ github.actor }}
Expand Down

0 comments on commit 8a28715

Please sign in to comment.