chore(mypy): Fix type annotation #1058
Workflow file for this run
This file contains 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
--- | |
name: Build Dockerfile if changed and run smoke tests | |
on: [pull_request] | |
env: | |
IMAGE_TAG: pr-test | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
arch: [amd64, arm64] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
fetch-depth: 0 | |
- name: Get changed Docker related files | |
id: changed-files-specific | |
# yamllint disable-line rule:line-length | |
uses: tj-actions/changed-files@d6babd6899969df1a11d14c368283ea4436bca78 # v44.5.2 | |
with: | |
files: | | |
Dockerfile | |
.dockerignore | |
tools/entrypoint.sh | |
.github/workflows/build-image-test.yaml | |
tools/*.sh | |
- name: Set up QEMU | |
if: matrix.os != 'ubuntu-latest' || matrix.arch != 'amd64' | |
# yamllint disable-line rule:line-length | |
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0 | |
with: | |
platforms: arm64 | |
- name: Set up Docker Buildx | |
# yamllint disable-line rule:line-length | |
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0 | |
- name: Build if Dockerfile changed | |
if: steps.changed-files-specific.outputs.any_changed == 'true' | |
# yamllint disable-line rule:line-length | |
uses: docker/build-push-action@94f8f8c2eec4bc3f1d78c1755580779804cb87b2 # v6.0.1 | |
with: | |
context: . | |
build-args: | | |
INSTALL_ALL=true | |
# yamllint disable-line rule:line-length | |
platforms: >- # Only one allowed here, see https://github.com/docker/buildx/issues/59#issuecomment-1433097926 | |
linux/${{ matrix.arch }} | |
push: false | |
load: true | |
tags: | | |
ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }} | |
# Fix multi-platform: https://github.com/docker/buildx/issues/1533 | |
provenance: false | |
secrets: | | |
"github_token=${{ secrets.GITHUB_TOKEN }}" | |
- name: Run structure tests | |
if: steps.changed-files-specific.outputs.any_changed == 'true' | |
# yamllint disable-line rule:line-length | |
uses: plexsystems/container-structure-test-action@c0a028aa96e8e82ae35be556040340cbb3e280ca # v0.3.0 | |
with: | |
image: ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }} | |
config: .github/.container-structure-test-config.yaml | |
- name: Dive - check image for waste files | |
if: steps.changed-files-specific.outputs.any_changed == 'true' | |
# yamllint disable-line rule:line-length | |
uses: MaxymVlasov/dive-action@379af3fc636888ada5899c997e8b52db6ad45023 # v1.0.1 | |
with: | |
image: ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }} | |
config-file: ${{ github.workspace }}/.github/.dive-ci.yaml | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
# Can't build both platforms and use --load at the same time | |
# https://github.com/docker/buildx/issues/59#issuecomment-1433097926 | |
- name: Build Multi-arch docker-image | |
if: >- | |
steps.changed-files-specific.outputs.any_changed == 'true' | |
&& matrix.os == 'ubuntu-latest' | |
&& matrix.arch == 'amd64' | |
# yamllint disable-line rule:line-length | |
uses: docker/build-push-action@94f8f8c2eec4bc3f1d78c1755580779804cb87b2 # v6.0.1 | |
with: | |
context: . | |
build-args: | | |
INSTALL_ALL=true | |
platforms: linux/amd64,linux/arm64 | |
push: false | |
tags: | | |
ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }} | |
# Fix multi-platform: https://github.com/docker/buildx/issues/1533 | |
provenance: false | |
secrets: | | |
"github_token=${{ secrets.GITHUB_TOKEN }}" |