# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. name: "Continuous Integration - Main/Release" on: push: # run on pushes to main or release/* branches: - main - release/* paths-ignore: - '**/README.md' - 'kustomize/**' - '.github/workflows/kustomize-build-ci.yaml' - 'terraform/**' - '.github/workflows/terraform-validate-ci.yaml' - 'helm-chart/**' - '.github/workflows/helm-chart-ci.yaml' jobs: code-tests: runs-on: [self-hosted, is-enabled] steps: - uses: actions/checkout@v6 - uses: actions/setup-dotnet@v5 env: DOTNET_INSTALL_DIR: "./.dotnet" with: dotnet-version: '10.0' - uses: actions/setup-go@v6 with: go-version: '1.25' - name: Go Unit Tests timeout-minutes: 10 run: | for SERVICE in "shippingservice" "productcatalogservice"; do echo "testing $SERVICE..." pushd src/$SERVICE go test popd done - name: C# Unit Tests timeout-minutes: 10 run: | dotnet test src/cartservice/ deployment-tests: runs-on: [self-hosted, is-enabled] needs: code-tests strategy: matrix: profile: ["local-code"] fail-fast: true steps: - uses: actions/checkout@v6 - name: Build + Deploy PR images to GKE timeout-minutes: 20 run: | PR_NUMBER=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }') NAMESPACE="pr${PR_NUMBER}" echo "::set-env name=NAMESPACE::$NAMESPACE" echo "::set-env name=PR_NUMBER::$PR_NUMBER" yes | gcloud auth configure-docker us-docker.pkg.dev gcloud container clusters get-credentials $PR_CLUSTER --region $REGION --project $PROJECT_ID cat <