From 06457aa780af0473aab544e2852dadfac8ebeafd Mon Sep 17 00:00:00 2001 From: Nick Satterly Date: Tue, 9 Apr 2024 12:21:20 +0200 Subject: [PATCH] Run tests before pushing to docker hub --- .github/workflows/release.yml | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cefcd46a..7526be45 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 }}