Skip to content

Commit

Permalink
Update e2e workflow file to support crd package e2e tests
Browse files Browse the repository at this point in the history
- configure crd image used
- add gcloud account setup for accessing gcr.io
- but make workflow to ignore test if missing service account secret
    When the workflow is run from fork, which does not have access to
    secrets in the main repo, noop the set up of the gcloud CLI, which
    is fine since the tests that requires it will be skipped for the
    same reasons anyway.

Signed-off-by: Vui Lam <[email protected]>
  • Loading branch information
vuil committed Feb 14, 2024
1 parent 15d31b6 commit 19acac2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/cli_core_e2e_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,29 @@ jobs:
restore-keys: |
${{ runner.os }}-go-
- name: Setup gcloud account
env:
GCP_SA: ${{ secrets.GCP_SA }}
GCP_PROJECT_NAME: ${{ secrets.GCP_PROJECT_NAME }}
run: |
if [ -n "$GCP_SA" ]; then
# Download and install Google Cloud SDK
wget https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz
tar zxvf google-cloud-sdk.tar.gz && ./google-cloud-sdk/install.sh --usage-reporting=false --path-update=true
PATH="google-cloud-sdk/bin:${PATH}"
gcloud --quiet components update
echo $GCP_SA > ${HOME}/gcloud-service-key.json
gcloud auth activate-service-account --key-file ${HOME}/gcloud-service-key.json
cat ${HOME}/gcloud-service-key.json | docker login -u _json_key --password-stdin https://gcr.io
gcloud config set project $GCP_PROJECT_NAME
fi
- name: Setup dependencies
run: |
make tools
echo "${PWD}/hack/tools/bin" >> $GITHUB_PATH
echo "${PWD}/google-cloud-sdk/bin" >> $GITHUB_PATH
echo "${PWD}/bin" >> $GITHUB_PATH
- name: Build CLI Core
Expand All @@ -56,6 +75,7 @@ jobs:
env:
TANZU_API_TOKEN: ${{ secrets.TANZU_API_TOKEN }}
TANZU_CLI_TMC_UNSTABLE_URL: ${{ secrets.TANZU_CLI_TMC_UNSTABLE_URL }}
CRD_PACKAGE_IMAGE : ${{ secrets.CRD_PACKAGE_IMAGE_FOR_TEST }}
run: |
make e2e-cli-core
Expand Down

0 comments on commit 19acac2

Please sign in to comment.