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 06457aa
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,36 @@ env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

jobs:
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
runs-on: ubuntu-latest
Expand All @@ -31,7 +61,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 06457aa

Please sign in to comment.