Update from update/networkservicemesh/integration-k8s-kind #1154
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
--- | |
name: ci | |
on: | |
pull_request: | |
push: | |
branches: | |
- 'release/**' | |
jobs: | |
yamllint: | |
uses: networkservicemesh/.github/.github/workflows/yamllint.yaml@main | |
shellcheck: | |
uses: networkservicemesh/.github/.github/workflows/shellcheck.yaml@main | |
golangci-lint: | |
uses: networkservicemesh/.github/.github/workflows/golangci-lint.yaml@main | |
exclude-fmt-errorf: | |
uses: networkservicemesh/.github/.github/workflows/exclude-fmt-errorf.yaml@main | |
checkgomod: | |
uses: networkservicemesh/.github/.github/workflows/checkgomod.yaml@main | |
gke: | |
environment: GKE | |
name: Google Kubernetes Engine | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up /bin permissions | |
run: | | |
sudo chmod -R 777 /bin | |
- name: Checkout deployments | |
uses: actions/checkout@v4 | |
with: | |
repository: networkservicemesh/deployments-k8s | |
path: networkservicemesh/deployments-k8s | |
- name: Checkout files | |
uses: actions/checkout@v4 | |
with: | |
path: ${{ github.repository }} | |
- name: Set up go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.20.5 | |
- uses: 'google-github-actions/auth@v2' | |
with: | |
project_id: ${{ secrets.GOOGLE_PROJECT_ID }} | |
credentials_json: ${{ secrets.GCLOUD_SERVICE_KEY }} | |
- name: Install gcloud-sdk | |
uses: google-github-actions/setup-gcloud@v2 | |
- name: Setup cluster | |
working-directory: ${{ github.repository }} | |
run: | | |
gcloud components install gke-gcloud-auth-plugin | |
gcloud components update | |
gcloud container clusters create "${GKE_CLUSTER_NAME}" --project="${GKE_PROJECT_ID}" --machine-type="${GKE_CLUSTER_TYPE}" --num-nodes="${GKE_CLUSTER_NUM_NODES}" --zone="${GKE_CLUSTER_ZONE}" --enable-gvnic -q | |
echo "Writing config to ${KUBECONFIG}" | |
gcloud container clusters get-credentials "${GKE_CLUSTER_NAME}" --project="${GKE_PROJECT_ID}" --zone="${GKE_CLUSTER_ZONE}" | |
env: | |
GKE_PROJECT_ID: ${{ secrets.GOOGLE_PROJECT_ID }} | |
GKE_CLUSTER_NAME: gke-${{ github.run_id }}-${{ github.run_number }} | |
GKE_CLUSTER_ZONE: us-central1-a | |
GKE_CLUSTER_TYPE: n1-standard-2 | |
GKE_CLUSTER_NUM_NODES: 2 | |
KUBECONFIG: config | |
USE_GKE_GCLOUD_AUTH_PLUGIN: true | |
- name: Run integration tests | |
working-directory: ${{ github.repository }} | |
run: | | |
export KUBECONFIG=$(pwd)/config | |
go test -count 1 -timeout 1h55m -race -v ./... -parallel 4 | |
env: | |
ARTIFACTS_DIR: logs | |
USE_GKE_GCLOUD_AUTH_PLUGIN: true | |
- name: Cleanup | |
if: ${{ always() }} | |
working-directory: ${{ github.repository }} | |
run: | | |
gcloud container clusters delete "${GKE_CLUSTER_NAME}" --project="${GKE_PROJECT_ID}" --zone="${GKE_CLUSTER_ZONE}" -q | |
env: | |
GKE_PROJECT_ID: ${{ secrets.GOOGLE_PROJECT_ID }} | |
GKE_CLUSTER_NAME: gke-${{ github.run_id }}-${{ github.run_number }} | |
GKE_CLUSTER_ZONE: us-central1-a | |
- name: Upload logs | |
uses: actions/upload-artifact@v3 | |
if: ${{ always() }} | |
with: | |
name: logs-${{ github.run_number }} | |
path: ${{ github.repository }}/logs |