diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 00000000..f861da2a --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,26 @@ +on: + push: + branches: + - "**" + pull_request: + workflow_call: + +name: Test Docker Container + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Build Docker image + run: docker build -t test-image . + + - name: Verify binary exists and runs + run: | + # Run container and execute the binaries to verify they exist and run + docker run --rm test-image datadog-static-analyzer --help + docker run --rm test-image datadog-static-analyzer-server --help + docker run --rm test-image datadog-static-analyzer-git-hook --help diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c6c9a46d..1a5b2908 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,6 +12,9 @@ jobs: test-rules: uses: './.github/workflows/test-rules.yaml' + test-docker-build: + uses: './.github/workflows/docker-build.yml' + integration-tests: uses: './.github/workflows/integration-tests.yaml' secrets: inherit @@ -100,6 +103,7 @@ jobs: name: Release on GitHub needs: - test-rules + - test-docker-build - integration-tests - verify-schema - versions-check