Merge pull request #904 from DataDog/akim.sadaoui/release-0.8.4 #329
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| push: | |
| paths: | |
| - "Dockerfile" | |
| - "rust-toolchain.toml" | |
| - "Cargo.lock" | |
| - "**/Cargo.toml" | |
| - ".github/workflows/docker-build.yml" | |
| branches: | |
| - "**" | |
| pull_request: | |
| paths: | |
| - "Dockerfile" | |
| - "rust-toolchain.toml" | |
| - "Cargo.lock" | |
| - "**/Cargo.toml" | |
| - ".github/workflows/docker-build.yml" | |
| workflow_call: | |
| name: Test Docker Container | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| platform: [linux/amd64, linux/arm64] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Set up Docker BuildKit | |
| uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 | |
| - name: Build Docker image for ${{ matrix.platform }} | |
| run: | | |
| docker buildx build --platform ${{ matrix.platform }} --load -t cross-test . | |
| - name: Verify binary architecture | |
| run: | | |
| EXPECTED_ARCH="${{ matrix.platform == 'linux/amd64' && 'x86-64' || 'aarch64' }}" | |
| tmp_file=$(mktemp) | |
| docker create --name check-arch cross-test | |
| docker cp check-arch:/usr/bin/datadog-static-analyzer "$tmp_file" | |
| docker rm check-arch | |
| FILE_OUTPUT=$(file "$tmp_file") | |
| echo "$FILE_OUTPUT" | |
| echo "$FILE_OUTPUT" | grep -q "$EXPECTED_ARCH" | |
| - name: Verify PATH | |
| if: matrix.platform == 'linux/amd64' | |
| run: | | |
| docker run --rm cross-test datadog-static-analyzer --help | |
| docker run --rm cross-test datadog-static-analyzer-server --help | |
| docker run --rm cross-test datadog-static-analyzer-git-hook --help |