forked from virtual-kubelet/azure-aci
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Fix e2e pipelines (virtual-kubelet#592)
Signed-off-by: Heba Elayoty <[email protected]>
- Loading branch information
1 parent
1060ca7
commit 7640261
Showing
2 changed files
with
32 additions
and
69 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,33 +12,19 @@ on: | |
branches: [master] | ||
paths-ignore: ['docs/**', '**.md', '**.mdx', '**.png', '**.jpg'] | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
# Common versions | ||
GO_VERSION: '1.20' | ||
GO_VERSION: '1.20' # Common versions | ||
E2E_IMG_TAG: 'e2e-ci' | ||
|
||
jobs: | ||
export-registry: | ||
runs-on: ubuntu-20.04 | ||
outputs: | ||
registry: ${{ steps.export.outputs.registry }} | ||
steps: | ||
- id: export | ||
run: | | ||
# registry must be in lowercase | ||
echo "::set-output name=registry::$(echo "${{ env.REGISTRY }}/${{ github.repository }}" | tr [:upper:] [:lower:])" | ||
permissions: | ||
id-token: write # This is required for requesting the JWT | ||
contents: read # This is required for actions/checkout | ||
|
||
jobs: | ||
aks-addon-e2e-tests: | ||
needs: export-registry | ||
environment: test | ||
env: | ||
REGISTRY: ${{ needs.export-registry.outputs.registry }} | ||
E2E_IMG_TAG: "e2e-ci" | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go ${{ env.GO_VERSION }} | ||
uses: actions/setup-go@v5 | ||
|
@@ -51,30 +37,26 @@ jobs: | |
ref: ${{ github.event.pull_request.head.ref }} | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
|
||
- name: Shorten SHA | ||
id: vars | ||
run: echo "::set-output name=pr_sha_short::$(git rev-parse --short ${{ github.event.pull_request.head.sha }} )" | ||
- name: Get Repo | ||
run: | | ||
echo "REGISTRY=$(echo "${{ env.REGISTRY }}/${{ github.repository }}" | tr [:upper:] [:lower:])" >> $GITHUB_ENV | ||
- name: Set e2e Cluster Name | ||
run: | | ||
rand=${{ steps.vars.outputs.pr_sha_short }} | ||
echo "pr_sha_short=$(git rev-parse --short ${{ github.event.pull_request.head.sha }} )" >> $GITHUB_ENV | ||
rand=${{ env.pr_sha_short }} | ||
if [ "$rand" = "" ]; then | ||
rand=$RANDOM | ||
fi | ||
echo "CLUSTER_NAME=aks-addon-vk-test${rand}" >> $GITHUB_ENV | ||
- name: Install Azure CLI latest | ||
run: | | ||
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash | ||
az version | ||
- uses: azure/[email protected] | ||
with: | ||
client-id: ${{ secrets.CLIENTID }} | ||
tenant-id: ${{ secrets.TENANT_ID }} | ||
subscription-id: ${{ secrets.SUBSCRIPTIONID }} | ||
client-id: ${{ secrets.AZURE_CLIENT_ID }} | ||
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | ||
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
|
||
- name: Run e2e test | ||
run: | | ||
|
@@ -85,7 +67,7 @@ jobs: | |
CLUSTER_NAME: ${{ env.CLUSTER_NAME }} | ||
VERSION: ${{ env.E2E_IMG_TAG}} | ||
E2E_TARGET: "pr" | ||
PR_COMMIT_SHA: ${{ steps.vars.outputs.pr_sha_short }} | ||
PR_COMMIT_SHA: ${{ env.pr_sha_short }} | ||
|
||
- name: Cleanup e2e resources | ||
if: ${{ always() }} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request_target: | ||
branches: | ||
- master | ||
|
@@ -15,33 +14,19 @@ on: | |
- '.github/workflows/chart.yml' | ||
- 'charts/**' | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
GO_VERSION: '1.20' # Common versions | ||
E2E_IMG_TAG: "e2e-ci" | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
# Common versions | ||
GO_VERSION: '1.20' | ||
|
||
jobs: | ||
export-registry: | ||
runs-on: ubuntu-20.04 | ||
outputs: | ||
registry: ${{ steps.export.outputs.registry }} | ||
steps: | ||
- id: export | ||
run: | | ||
# registry must be in lowercase | ||
echo "::set-output name=registry::$(echo "${{ env.REGISTRY }}/${{ github.repository }}" | tr [:upper:] [:lower:])" | ||
e2e-tests: | ||
needs: export-registry | ||
environment: test | ||
env: | ||
REGISTRY: ${{ needs.export-registry.outputs.registry }} | ||
E2E_IMG_TAG: "e2e-ci" | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go ${{ env.GO_VERSION }} | ||
uses: actions/setup-go@v5 | ||
|
@@ -54,30 +39,26 @@ jobs: | |
ref: ${{ github.event.pull_request.head.ref }} | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
|
||
- name: Shorten SHA | ||
id: vars | ||
run: echo "::set-output name=pr_sha_short::$(git rev-parse --short ${{ github.event.pull_request.head.sha }} )" | ||
- name: Get Repo | ||
run: | | ||
echo "REGISTRY=$(echo "${{ env.REGISTRY }}/${{ github.repository }}" | tr [:upper:] [:lower:])" >> $GITHUB_ENV | ||
- name: Set e2e Cluster Name | ||
run: | | ||
rand=${{ steps.vars.outputs.pr_sha_short }} | ||
echo "pr_sha_short=$(git rev-parse --short ${{ github.event.pull_request.head.sha }} )" >> $GITHUB_ENV | ||
rand=${{ env.pr_sha_short }} | ||
if [ "$rand" = "" ]; then | ||
rand=$RANDOM | ||
fi | ||
echo "CLUSTER_NAME=vk-aci-test${rand}" >> $GITHUB_ENV | ||
- name: Install Azure CLI latest | ||
run: | | ||
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash | ||
az version | ||
- uses: azure/[email protected] | ||
with: | ||
client-id: ${{ secrets.CLIENTID }} | ||
tenant-id: ${{ secrets.TENANT_ID }} | ||
subscription-id: ${{ secrets.SUBSCRIPTIONID }} | ||
client-id: ${{ secrets.AZURE_CLIENT_ID }} | ||
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | ||
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
|
||
- name: Run e2e test | ||
run: | | ||
|