Skip to content

Commit

Permalink
ci(fix): Skip configure condition (#1262)
Browse files Browse the repository at this point in the history
* ci(fix): skip aws configure from fork

Signed-off-by: Jingwei Wang <jweiw@amazon.com>

fix optional linux2

Signed-off-by: Jingwei Wang <jweiw@amazon.com>

fix: AL2

fix: AL2 condition

Signed-off-by: Jingwei Wang <jweiw@amazon.com>

* fix: AL2 conditions

Signed-off-by: Jingwei Wang <jweiw@amazon.com>

fix: if conditions

Signed-off-by: Jingwei Wang <jweiw@amazon.com>

test if consition different than local test

Signed-off-by: Jingwei Wang <jweiw@amazon.com>

test if consition different than local test

Signed-off-by: Jingwei Wang <jweiw@amazon.com>

test if consition different than local test

Signed-off-by: Jingwei Wang <jweiw@amazon.com>

test if consition different than local test

Signed-off-by: Jingwei Wang <jweiw@amazon.com>

test if consition different than local test

Signed-off-by: Jingwei Wang <jweiw@amazon.com>

test if consition different than local test

Signed-off-by: Jingwei Wang <jweiw@amazon.com>

test if consition different than local test

Signed-off-by: Jingwei Wang <jweiw@amazon.com>

test if consition different than local test

Signed-off-by: Jingwei Wang <jweiw@amazon.com>

---------

Signed-off-by: Jingwei Wang <jweiw@amazon.com>
  • Loading branch information
sky1122 authored Jan 29, 2025
1 parent 35f1013 commit d5c8ea7
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 45 deletions.
38 changes: 18 additions & 20 deletions .github/workflows/e2e-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,52 +152,50 @@ jobs:
"${{ inputs.runner-type }}",
]
steps:
- name: Set output variables to check AL2
id: linux2
run: |
is_al2=${{ (startsWith(inputs.os, 'amazon') && inputs.version == '2' ) }}
echo "is_al2=$is_al2" >> $GITHUB_OUTPUT
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
if: >-
${{ needs.test.outputs.has_creds == 'true'
&& ((startsWith(inputs.os, 'amazon')
&& inputs.version != '2' ))
if: |
steps.linux2.outputs.is_al2 == 'false'
&& needs.test.outputs.has_creds == 'true'
&& github.event_name == 'pull_request'
&& github.event.action == 'closed'
&& github.event.pull_request.merged == true
}}
with:
role-to-assume: ${{ secrets.ROLE }}
role-session-name: credhelper-test
aws-region: ${{ secrets.REGION }}
- name: download artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.08
if: >-
${{ needs.test.outputs.has_creds == 'true'
&& ((startsWith(inputs.os, 'amazon')
&& inputs.version != '2' ))
if: |
steps.linux2.outputs.is_al2 == 'false'
&& needs.test.outputs.has_creds == 'true'
&& github.event_name == 'pull_request'
&& github.event.action == 'closed'
&& github.event.pull_request.merged == true
}}
with:
name: linux-${{ inputs.version }}-${{ inputs.test-command }}-${{ inputs.arch }}-${{ github.run_id }}-${{ github.run_attempt }}-e2e-reports
path: linux-${{ inputs.version }}-${{ inputs.test-command }}-${{ inputs.arch }}-${{ github.run_id }}-${{ github.run_attempt }}-e2e-reports
- name: Display structure of downloaded files
if: >-
${{ needs.test.outputs.has_creds == 'true'
&& ((startsWith(inputs.os, 'amazon')
&& inputs.version != '2' ))
if: |
steps.linux2.outputs.is_al2 == 'false'
&& needs.test.outputs.has_creds == 'true'
&& github.event_name == 'pull_request'
&& github.event.action == 'closed'
&& github.event.pull_request.merged == true
}}
run: ls -R linux-${{ inputs.version }}-${{ inputs.test-command }}-${{ inputs.arch }}-${{ github.run_id }}-${{ github.run_attempt }}-e2e-reports
- name: Check and upload e2e tests reports to s3 bucket
if: >-
${{ needs.test.outputs.has_creds == 'true'
&& ((startsWith(inputs.os, 'amazon')
&& inputs.version != '2' ))
if: |
steps.linux2.outputs.is_al2 == 'false'
&& needs.test.outputs.has_creds == 'true'
&& github.event_name == 'pull_request'
&& github.event.action == 'closed'
&& github.event.pull_request.merged == true
}}
run: |
VM_REPORT="${{ github.workspace }}/linux-${{ inputs.version }}-${{ inputs.test-command }}-${{ inputs.arch }}-${{ github.run_id }}-${{ github.run_attempt }}-e2e-reports/${{ github.run_id }}-${{ github.run_attempt }}-e2e-vm-report.json"
CONTAINER_REPORT="${{ github.workspace }}/linux-${{ inputs.version }}-${{ inputs.test-command }}-${{ inputs.arch }}-${{ github.run_id }}-${{ github.run_attempt }}-e2e-reports/${{ github.run_id }}-${{ github.run_attempt }}-e2e-container-report.json"
Expand Down
33 changes: 15 additions & 18 deletions .github/workflows/e2e-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,37 +116,34 @@ jobs:
steps:
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
if: >-
${{ needs.test.outputs.has_creds == 'true'
&& github.event_name == 'pull_request'
&& github.event.action == 'closed'
&& github.event.pull_request.merged == true
}}
if: |
needs.test.outputs.has_creds == 'true'
&& github.event_name == 'pull_request'
&& github.event.action == 'closed'
&& github.event.pull_request.merged == true
with:
role-to-assume: ${{ secrets.ROLE }}
role-session-name: credhelper-test
aws-region: ${{ secrets.REGION }}
- name: download artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.08
if: >-
${{ needs.test.outputs.has_creds == 'true'
&& github.event_name == 'pull_request'
&& github.event.action == 'closed'
&& github.event.pull_request.merged == true
}}
if: |
needs.test.outputs.has_creds == 'true'
&& github.event_name == 'pull_request'
&& github.event.action == 'closed'
&& github.event.pull_request.merged == true
with:
name: macos-${{ inputs.version }}-${{ inputs.test-command }}-${{ inputs.arch }}-${{ github.run_id }}-${{ github.run_attempt }}-e2e-reports
path: macos-${{ inputs.version }}-${{ inputs.test-command }}-${{ inputs.arch }}-${{ github.run_id }}-${{ github.run_attempt }}-e2e-reports
- name: Display structure of downloaded files
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
run: ls -R macos-${{ inputs.version }}-${{ inputs.test-command }}-${{ inputs.arch }}-${{ github.run_id }}-${{ github.run_attempt }}-e2e-reports
- name: Check and upload e2e tests reports to s3 bucket
if: >-
${{ needs.test.outputs.has_creds == 'true'
&& github.event_name == 'pull_request'
&& github.event.action == 'closed'
&& github.event.pull_request.merged == true
}}
if: |
needs.test.outputs.has_creds == 'true'
&& github.event_name == 'pull_request'
&& github.event.action == 'closed'
&& github.event.pull_request.merged == true
run: |
VM_REPORT="${{ github.workspace }}/macos-${{ inputs.version }}-${{ inputs.test-command }}-${{ inputs.arch }}-${{ github.run_id }}-${{ github.run_attempt }}-e2e-reports/${{ github.run_id }}-${{ github.run_attempt }}-e2e-vm-report.json"
CONTAINER_REPORT="${{ github.workspace }}/macos-${{ inputs.version }}-${{ inputs.test-command }}-${{ inputs.arch }}-${{ github.run_id }}-${{ github.run_attempt }}-e2e-reports/${{ github.run_id }}-${{ github.run_attempt }}-e2e-container-report.json"
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/e2e-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,27 +126,24 @@ jobs:
- name: Set output variables
id: vars
run: |
$has_creds="${{ github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' &&
github.event_name == 'pull_request' &&
github.event.action == 'closed' &&
github.event.pull_request.merged == true}}"
$has_creds="${{ github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' && github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true }}"
echo "has_creds=$has_creds" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
exit 0 # if $has_creds is false, powershell will exit with code 1 and this step will fail
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
if: ${{ env.has_creds == 'true' }}
if: env.has_creds == 'true'
with:
role-to-assume: ${{ secrets.ROLE }}
role-session-name: credhelper-test
aws-region: ${{ secrets.REGION }}
- name: download artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.08
if: ${{ env.has_creds == 'true' }}
if: env.has_creds == 'true'
with:
name: windows-${{ inputs.test-command }}-${{ inputs.arch }}-${{ github.run_id }}-${{ github.run_attempt }}-e2e-reports
path: windows-${{ inputs.test-command }}-${{ inputs.arch }}-${{ github.run_id }}-${{ github.run_attempt }}-e2e-reports
- name: Check and upload e2e tests reports to s3 bucket
if: ${{ env.has_creds == 'true' }}
if: env.has_creds == 'true'
run: |
$env:VM_REPORT = "${{ github.workspace }}\windows-${{ inputs.test-command }}-${{ inputs.arch }}-${{ github.run_id }}-${{ github.run_attempt }}-e2e-reports\${{ github.run_id }}-${{ github.run_attempt }}-e2e-vm-report.json"
$env:CONTAINER_REPORT = "${{ github.workspace }}\windows-${{ inputs.test-command }}-${{ inputs.arch }}-${{ github.run_id }}-${{ github.run_attempt }}-e2e-reports\${{ github.run_id }}-${{ github.run_attempt }}-e2e-container-report.json"
Expand Down

0 comments on commit d5c8ea7

Please sign in to comment.