-
Notifications
You must be signed in to change notification settings - Fork 942
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support arm64 #5320
base: main
Are you sure you want to change the base?
Support arm64 #5320
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ jobs: | |
name: Build and Test | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
contents: read | ||
concurrency: | ||
# Ref: https://docs.github.com/en/actions/learn-github-actions/contexts#github-context | ||
# github.head_ref: head_ref or source branch of the pull request | ||
|
@@ -27,9 +27,17 @@ jobs: | |
images: | ||
- prefix: slim- | ||
target: slim | ||
platform: linux/amd64 | ||
- prefix: "" | ||
target: standard | ||
timeout-minutes: 60 | ||
platform: linux/amd64 | ||
- prefix: slim- | ||
target: slim | ||
platform: linux/arm64/v8 | ||
- prefix: "" | ||
target: standard | ||
platform: linux/arm64/v8 | ||
timeout-minutes: 180 | ||
env: | ||
CONTAINER_IMAGE_ID: "ghcr.io/super-linter/super-linter:${{ matrix.images.prefix }}latest" | ||
CONTAINER_IMAGE_TARGET: "${{ matrix.images.target }}" | ||
|
@@ -84,6 +92,9 @@ jobs: | |
sudo rm -rf /opt/ghc || true | ||
sudo rm -rf /usr/local/.ghcup || true | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
|
@@ -99,6 +110,7 @@ jobs: | |
cache-from: type=registry,ref=${{ env.CONTAINER_IMAGE_ID }}-buildcache | ||
outputs: type=docker,dest=/tmp/${{ env.CONTAINER_IMAGE_OUTPUT_IMAGE_NAME }}.tar | ||
push: false | ||
platforms: ${{ matrix.images.platform }} | ||
secrets: | | ||
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} | ||
tags: | | ||
|
@@ -114,6 +126,7 @@ jobs: | |
|
||
- name: Test Local Action (debug log) | ||
uses: ./ | ||
if: matrix.images.platform == 'linux/amd64' | ||
env: | ||
LOG_LEVEL: DEBUG | ||
CREATE_LOG_FILE: true | ||
|
@@ -125,11 +138,13 @@ jobs: | |
TYPESCRIPT_STANDARD_TSCONFIG_FILE: ".github/linters/tsconfig.json" | ||
|
||
- name: Get the contents of the log file | ||
if: matrix.images.platform == 'linux/amd64' | ||
run: | | ||
sudo cat super-linter.log | ||
sudo rm -v super-linter.log | ||
|
||
- name: Test Local Action (default log) | ||
if: matrix.images.platform == 'linux/amd64' | ||
uses: ./ | ||
env: | ||
VALIDATE_ALL_CODEBASE: false | ||
|
@@ -144,6 +159,7 @@ jobs: | |
run: make validate-container-image-labels | ||
|
||
- name: Upload ${{ env.CONTAINER_IMAGE_OUTPUT_IMAGE_NAME }} container image | ||
if: matrix.images.platform == 'linux/amd64' | ||
uses: actions/[email protected] | ||
with: | ||
name: ${{ env.CONTAINER_IMAGE_OUTPUT_IMAGE_NAME }} | ||
|
@@ -220,7 +236,7 @@ jobs: | |
if: github.event_name == 'pull_request' && github.repository == github.event.pull_request.head.repo.full_name && github.repository == 'super-linter/super-linter' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,24 @@ function ValidateBooleanConfigurationVariables() { | |
ValidateBooleanVariable "YAML_ERROR_ON_WARNING" "${YAML_ERROR_ON_WARNING}" | ||
} | ||
|
||
function ValidatePlatformArchitecture() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we shouldn't validate this at runtime, but rather when we build the image. Also, we wouldn't want to silently disable linters in the case that they aren't available on a given platform. I would revert this change and the related function call in Thanks! |
||
local PLATFORM_ARCHITECTURE | ||
PLATFORM_ARCHITECTURE=$(uname -m) | ||
debug "Platform architecture: ${PLATFORM_ARCHITECTURE}" | ||
|
||
if [[ "${PLATFORM_ARCHITECTURE}" == "x86_64" ]]; then | ||
return 0 | ||
fi | ||
|
||
if [[ "${PLATFORM_ARCHITECTURE}" == "aarch64" || "${PLATFORM_ARCHITECTURE}" == "arm64" ]]; then | ||
eval "export VALIDATE_SCALAFMT='false'" | ||
eval "export VALIDATE_POWERSHELL='false'" | ||
return 0 | ||
fi | ||
|
||
fatal "Unsupported platform architecture: ${PLATFORM_ARCHITECTURE}" | ||
} | ||
|
||
function ValidateGitHubWorkspace() { | ||
local GITHUB_WORKSPACE | ||
GITHUB_WORKSPACE="${1}" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,6 +108,7 @@ declare -l YAML_ERROR_ON_WARNING | |
YAML_ERROR_ON_WARNING="${YAML_ERROR_ON_WARNING:-false}" | ||
|
||
ValidateBooleanConfigurationVariables | ||
ValidatePlatformArchitecture | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you revert this change as well? See my previous comment. |
||
|
||
########### | ||
# GLOBALS # | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,7 +60,6 @@ LINTER_NAMES_ARRAY['R']="R" | |
LINTER_NAMES_ARRAY['RAKU']="raku" | ||
LINTER_NAMES_ARRAY['RENOVATE']="renovate-config-validator" | ||
LINTER_NAMES_ARRAY['RUBY']="rubocop" | ||
LINTER_NAMES_ARRAY['SCALAFMT']="scalafmt" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one is going to be a bit more challenging. Is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, not available yet. i don't know anything about scala and is having a hard time contributing a multi-arch image for it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems that there's a scalafmt-macos executable available since a few releases? Maybe that's useful in this case? |
||
LINTER_NAMES_ARRAY['SHELL_SHFMT']="shfmt" | ||
LINTER_NAMES_ARRAY['SNAKEMAKE_LINT']="snakemake" | ||
LINTER_NAMES_ARRAY['SNAKEMAKE_SNAKEFMT']="snakefmt" | ||
|
@@ -79,15 +78,22 @@ LINTER_NAMES_ARRAY['TYPESCRIPT_STANDARD']="ts-standard" | |
LINTER_NAMES_ARRAY['XML']="xmllint" | ||
LINTER_NAMES_ARRAY['YAML']="yamllint" | ||
|
||
if [[ "${TARGETARCH}" == "amd64" ]]; then | ||
LINTER_NAMES_ARRAY['SCALAFMT']="scalafmt" | ||
fi | ||
|
||
if [[ "${IMAGE}" == "standard" ]]; then | ||
LINTER_NAMES_ARRAY['ARM']="arm-ttk" | ||
LINTER_NAMES_ARRAY['CSHARP']="dotnet" | ||
LINTER_NAMES_ARRAY['ENV']="dotenv-linter" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems that dotenv-linter has an arm64 image? dotenv-linter/dotenv-linter#533 |
||
LINTER_NAMES_ARRAY['POWERSHELL']="pwsh" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. arm64 request tracked in PowerShell/PowerShell-Docker#795 |
||
LINTER_NAMES_ARRAY['RUST_2015']="rustfmt" | ||
LINTER_NAMES_ARRAY['RUST_2018']="rustfmt" | ||
LINTER_NAMES_ARRAY['RUST_2021']="rustfmt" | ||
LINTER_NAMES_ARRAY['RUST_CLIPPY']="clippy" | ||
|
||
if [[ "${TARGETARCH}" == "amd64" ]]; then | ||
LINTER_NAMES_ARRAY['ENV']="dotenv-linter" | ||
LINTER_NAMES_ARRAY['POWERSHELL']="pwsh" | ||
fi | ||
Comment on lines
+93
to
+96
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These two linters are only available in the |
||
fi | ||
|
||
echo "Building linter version file: ${VERSION_FILE}" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's see if that Checkov PR lands in, so we can skip this part.