Skip to content

Commit

Permalink
Split Run Test Cases step by platform
Browse files Browse the repository at this point in the history
  • Loading branch information
bdovaz committed Feb 26, 2023
1 parent 7a41835 commit af6a7ed
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/deploy-DEV-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ jobs:
#####################################
# Run Linter test cases #
#####################################
- name: Run Test Cases
- name: Run Test Cases (linux/amd64)
shell: bash
run: |
GITHUB_REPOSITORY=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.event.pull_request.head.repo.full_name }}" || echo "${{ github.repository }}")
Expand All @@ -230,9 +230,21 @@ jobs:
TEST_KEYWORDS_TO_USE="${TEST_KEYWORDS_TO_USE_UPPER,,}"
docker buildx build --platform linux/amd64 -f linters/${{ matrix.linter }}/Dockerfile --load --tag oxsecurity/megalinter-only-${{ matrix.linter }}:${{ needs.prepare.outputs.tag }} .
docker buildx build --platform linux/arm64 -f linters/${{ matrix.linter }}/Dockerfile --load --tag oxsecurity/megalinter-only-${{ matrix.linter }}:${{ needs.prepare.outputs.tag }}-arm64 .
docker run -e TEST_CASE_RUN=true -e OUTPUT_FORMAT=text -e OUTPUT_FOLDER=${{ github.sha }} -e OUTPUT_DETAIL=detailed -e GITHUB_SHA=${{ github.sha }} -e GITHUB_REPOSITORY=${GITHUB_REPOSITORY} -e GITHUB_BRANCH=${GITHUB_BRANCH} -e PAT="${{ secrets.PAT }}" -e TEST_KEYWORDS="${TEST_KEYWORDS_TO_USE}" -e MEGALINTER_VOLUME_ROOT="${GITHUB_WORKSPACE}" -v "/var/run/docker.sock:/var/run/docker.sock:rw" -v ${GITHUB_WORKSPACE}:/tmp/lint oxsecurity/megalinter-only-${{ matrix.linter }}:${{ needs.prepare.outputs.tag }}
timeout-minutes: 30

- name: Run Test Cases (linux/arm64)
shell: bash
run: |
GITHUB_REPOSITORY=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.event.pull_request.head.repo.full_name }}" || echo "${{ github.repository }}")
GITHUB_BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}")
TEST_KEYWORDS_TO_USE_UPPER="${{ matrix.linter }}"
TEST_KEYWORDS_TO_USE="${TEST_KEYWORDS_TO_USE_UPPER,,}"
docker buildx build --platform linux/arm64 -f linters/${{ matrix.linter }}/Dockerfile --load --tag oxsecurity/megalinter-only-${{ matrix.linter }}:${{ needs.prepare.outputs.tag }}-arm64 .
docker run -e TEST_CASE_RUN=true -e OUTPUT_FORMAT=text -e OUTPUT_FOLDER=${{ github.sha }} -e OUTPUT_DETAIL=detailed -e GITHUB_SHA=${{ github.sha }} -e GITHUB_REPOSITORY=${GITHUB_REPOSITORY} -e GITHUB_BRANCH=${GITHUB_BRANCH} -e PAT="${{ secrets.PAT }}" -e TEST_KEYWORDS="${TEST_KEYWORDS_TO_USE}" -e MEGALINTER_VOLUME_ROOT="${GITHUB_WORKSPACE}" -v "/var/run/docker.sock:/var/run/docker.sock:rw" -v ${GITHUB_WORKSPACE}:/tmp/lint oxsecurity/megalinter-only-${{ matrix.linter }}:${{ needs.prepare.outputs.tag }}-arm64
timeout-minutes: 30

Expand Down

0 comments on commit af6a7ed

Please sign in to comment.