chore(deps): bump golang.org/x/net from 0.45.0 to 0.46.0 in /http2/go-http2 #473
Workflow file for this run
This file contains hidden or 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: Sample apps test and update | |
| on: | |
| pull_request_target: | |
| branches: [ main ] | |
| types: [ opened, synchronize, reopened ] | |
| workflow_dispatch: | |
| permissions: | |
| pull-requests: write | |
| contents: write | |
| jobs: | |
| sample-app-test: | |
| runs-on: ubuntu-latest | |
| concurrency: test-landscape | |
| environment: cf_env | |
| env: | |
| HOSTNAME_PREFIX: gh-run-${{ github.run_id }}- | |
| steps: | |
| - name: Limit access | |
| if: | | |
| github.event_name == 'pull_request_target' && | |
| github.event.pull_request.head.repo.fork == 'true' | |
| run: | | |
| echo "Deployment not possible!" | |
| exit 1 | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: "refs/pull/${{ github.event.number }}/merge" | |
| - name: Setup java/jdk | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '11' | |
| java-package: jdk | |
| - name: Setup Gradle | |
| uses: gradle/gradle-build-action@v2 | |
| - name: Setup Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: 'stable' | |
| - name: Install grpcurl | |
| run: go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest | |
| - name: Install yq | |
| run: go install github.com/mikefarah/yq/v4@latest | |
| - name: Install CloudFoundry cf cli | |
| run: | | |
| wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add - | |
| echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list | |
| sudo apt-get update | |
| sudo apt-get install cf8-cli -y | |
| cf8 --version | |
| - name: Build Java apps | |
| run: ./http2/gradlew clean build -p http2 | |
| - name: Logging into target CloudFoundry | |
| run: cf8 login -a "${{ secrets.CF_API }}" -u "${{ secrets.CF_USERNAME }}" -p "${{ secrets.CF_PASSWORD }}" -o "${{ secrets.CF_ORG }}" -s "${{ secrets.CF_SPACE }}" --origin uaa | |
| - name: Deploy HTTP/2 sample apps | |
| run: cf8 push -f "${GITHUB_WORKSPACE}/http2/apps-manifest.yml" --var domain=${{ secrets.CF_DOMAIN }} --var hostname_prefix="$HOSTNAME_PREFIX" --vars-file "${GITHUB_WORKSPACE}/http2/gradle.properties" | |
| - name: Test HTTP/2 Sample apps | |
| run: | | |
| get_route() { | |
| echo "${HOSTNAME_PREFIX}${1}.${{ secrets.CF_DOMAIN }}" | |
| } | |
| echo "### Testing HTTP2_APP app ###" | |
| yq e '.applications.[].name' "${GITHUB_WORKSPACE}/http2/apps-manifest.yml" | grep -i 'http2' | while read -r HTTP2_APP; do | |
| curl -v --http2-prior-knowledge -H 'Connection: close' "https://$(get_route "$HTTP2_APP")" | |
| done | |
| echo "Testing GRPC apps" | |
| grpcurl $(get_route go-grpc-test):443 example.Example.Run | |
| grpcurl -proto http2/java-grpc/app/src/main/proto/example.proto $(get_route java-grpc-test):443 example.Example.Run | |
| grpcurl -proto http2/node-grpc/example.proto $(get_route node-grpc-test):443 Example.Run | |
| grpcurl -proto http2/python-grpc/example.proto $(get_route python-grpc-test):443 Example.Run | |
| grpcurl -proto http2/ruby-grpc/example.proto $(get_route ruby-grpc-test):443 Example.Run | |
| - name: Deploy IP Allow-List Sample App | |
| run: | | |
| cf8 push --var "domain=${{ secrets.CF_DOMAIN }}" --var "prefix=${HOSTNAME_PREFIX}" --manifest "${GITHUB_WORKSPACE}/ip-allow-listing-route-service/manifest.yml" | |
| cf8 create-user-provided-service "${HOSTNAME_PREFIX}allow-list" -r "https://${HOSTNAME_PREFIX}ip-allow-list-rs.${{ secrets.CF_DOMAIN }}" | |
| cf8 bind-route-service "${{ secrets.CF_DOMAIN }}" --hostname "${HOSTNAME_PREFIX}ok" "${HOSTNAME_PREFIX}allow-list" | |
| - name: Test IP Allow-List Sample App | |
| run: | | |
| echo "Test IPv4 is accessible" | |
| test "$(curl --silent --output /dev/null --write-out "%{http_code}" -4 "https://${HOSTNAME_PREFIX}ok.${{ secrets.CF_DOMAIN }}")" -eq 200 | |
| - name: Clean-up | |
| if: success() || failure() | |
| run: | | |
| echo "Deleting service instance" | |
| cf8 delete-service "allow-list-${HOSTNAME_PREFIX}" -f || true | |
| echo "Deleting apps and routes" | |
| yq e '.applications.[].name' "${GITHUB_WORKSPACE}/http2/apps-manifest.yml" | while read -r app_name; do | |
| echo "Deleting app: $app_name" | |
| cf8 delete "$app_name" -r -f || true | |
| done | |
| yq e '.applications.[].name' "${GITHUB_WORKSPACE}/ip-allow-listing-route-service/manifest.yml" | while read -r app_name; do | |
| echo "Deleting app: $app_name" | |
| cf8 delete "$app_name" -r -f || true | |
| done | |
| automerge: | |
| runs-on: ubuntu-latest | |
| if: github.actor == 'dependabot[bot]' | |
| needs: [sample-app-test] | |
| steps: | |
| - name: Approve | |
| run: gh pr review "${{ github.event.pull_request.html_url }}" --approve --body "Auto-approving dependency bump." | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Enable auto-merge | |
| run: gh pr merge "${{ github.event.pull_request.html_url }}" --auto --rebase | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |