Skip to content

Commit

Permalink
chore: remove stale examples (#645)
Browse files Browse the repository at this point in the history
* chore: remove stale examples

None of these examples are currently in-use in the docs and are more
confusing than useful. This commit removes them.

* Update version of Proxy and remove stale tests
  • Loading branch information
enocom authored May 14, 2024
1 parent 3a7c789 commit cab1c69
Show file tree
Hide file tree
Showing 40 changed files with 1 addition and 2,863 deletions.
155 changes: 0 additions & 155 deletions .github/workflows/sample-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,110 +67,8 @@ jobs:
id: filter
with:
filters: |
java:
- 'examples/java/**'
nodejs:
- 'examples/nodejs/**'
go:
- 'examples/go/**'
python:
- 'examples/python/**'
java:
# This ensures that the java job execute after the changes job, since it's dependent on
# that job's output.
needs: changes
if: ${{ needs.changes.outputs.java == 'true' || github.event_name == 'schedule' }}
runs-on: [self-hosted, linux, x64]
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- name: Setup Maven Action
uses: s4u/setup-maven-action@6d44c18d67d9e1549907b8815efa5e4dada1801b # v1.12.0
with:
java-version: 17

- name: Authenticate to Google Cloud
id: 'auth'
uses: google-github-actions/auth@55bd3a7c6e2ae7cf1877fd1ccb9d54c0503c457c # v2.1.2
with:
workload_identity_provider: ${{ secrets.PROVIDER_NAME }}
service_account: ${{ secrets.SERVICE_ACCOUNT }}

- name: 'Set up Cloud SDK'
uses: google-github-actions/setup-gcloud@98ddc00a17442e89a24bbf282954a3b65ce6d200 # v2.1.0
- name: Get Secrets
id: 'secrets'
uses: google-github-actions/get-secretmanager-secrets@61067887622dee4939d68e379b4264a57534fdf6 # v2.1.0
with:
secrets: |-
ALLOYDB_INSTANCE_NAME:alloydb-connector-testing/ALLOYDB_INSTANCE_NAME
ALLOYDB_CLUSTER_PASS:alloydb-connector-testing/ALLOYDB_CLUSTER_PASS
- name: Run lint
run: |
cd examples/java
mvn -P lint checkstyle:check
- name: Run tests
env:
DB_NAME: 'postgres'
DB_USER: 'postgres'
DB_PASS: '${{ steps.secrets.outputs.ALLOYDB_CLUSTER_PASS }}'
ALLOYDB_CONNECTION_NAME: '${{ steps.secrets.outputs.ALLOYDB_INSTANCE_NAME }}'
run: |
./examples/java/run_tests.sh
nodejs:
# This ensures that the Node.js job executes after the changes job, since it's dependent on
# that job's output.
needs: changes
if: ${{ needs.changes.outputs.nodejs == 'true' || github.event_name == 'schedule' }}
runs-on: [self-hosted, linux, x64]
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Setup Node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 14

- name: Authenticate to Google Cloud
id: 'auth'
uses: google-github-actions/auth@55bd3a7c6e2ae7cf1877fd1ccb9d54c0503c457c # v2.1.2
with:
workload_identity_provider: ${{ secrets.PROVIDER_NAME }}
service_account: ${{ secrets.SERVICE_ACCOUNT }}

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@98ddc00a17442e89a24bbf282954a3b65ce6d200 # v2.1.0
- name: Get Secrets
id: 'secrets'
uses: google-github-actions/get-secretmanager-secrets@61067887622dee4939d68e379b4264a57534fdf6 # v2.1.0
with:
secrets: |-
ALLOYDB_INSTANCE_NAME:alloydb-connector-testing/ALLOYDB_INSTANCE_NAME
ALLOYDB_CLUSTER_PASS:alloydb-connector-testing/ALLOYDB_CLUSTER_PASS
- name: Run tests
env:
DB_NAME: 'postgres'
DB_USER: 'postgres'
DB_PASS: '${{ steps.secrets.outputs.ALLOYDB_CLUSTER_PASS }}'
ALLOYDB_CONNECTION_NAME: '${{ steps.secrets.outputs.ALLOYDB_INSTANCE_NAME }}'
run: |
./examples/nodejs/run_tests.sh
go:
# This ensures that the go job executes after the changes job, since it's dependent on
# that job's output.
Expand Down Expand Up @@ -215,56 +113,3 @@ jobs:
ALLOYDB_CONNECTION_NAME: '${{ steps.secrets.outputs.ALLOYDB_INSTANCE_NAME }}'
run: |
./examples/go/run_tests.sh
python:
# This ensures that the python job executes after the changes job, since it's dependent on
# that job's output.
needs: changes
if: ${{ needs.changes.outputs.python == 'true' || github.event_name == 'schedule' }}
runs-on: [self-hosted, linux, x64]
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- name: Setup Python 3.11
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: '3.11'

- name: Authenticate to Google Cloud
id: 'auth'
uses: google-github-actions/auth@55bd3a7c6e2ae7cf1877fd1ccb9d54c0503c457c # v2.1.2
with:
workload_identity_provider: ${{ secrets.PROVIDER_NAME }}
service_account: ${{ secrets.SERVICE_ACCOUNT }}

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@98ddc00a17442e89a24bbf282954a3b65ce6d200 # v2.1.0
- name: Get Secrets
id: 'secrets'
uses: google-github-actions/get-secretmanager-secrets@61067887622dee4939d68e379b4264a57534fdf6 # v2.1.0
with:
secrets: |-
ALLOYDB_INSTANCE_NAME:alloydb-connector-testing/ALLOYDB_INSTANCE_NAME
ALLOYDB_CLUSTER_PASS:alloydb-connector-testing/ALLOYDB_CLUSTER_PASS
- name: Run lint
run: |
pip install --upgrade pip
pip install flake8
cd examples/python
python -m flake8 .
- name: Run tests
env:
DB_NAME: 'postgres'
DB_USER: 'postgres'
DB_PASS: '${{ steps.secrets.outputs.ALLOYDB_CLUSTER_PASS }}'
ALLOYDB_CONNECTION_NAME: '${{ steps.secrets.outputs.ALLOYDB_INSTANCE_NAME }}'
run: |
./examples/python/run_tests.sh
2 changes: 1 addition & 1 deletion examples/go/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
set -ex

# download the proxy and run it in the background listening on 127.0.0.1:5432
URL="https://storage.googleapis.com/alloydb-auth-proxy/v0.6.2"
URL="https://storage.googleapis.com/alloydb-auth-proxy/v1.9.0"
wget "$URL/alloydb-auth-proxy.linux.amd64" -O alloydb-auth-proxy
chmod +x alloydb-auth-proxy
./alloydb-auth-proxy "${ALLOYDB_CONNECTION_NAME}" &
Expand Down
20 changes: 0 additions & 20 deletions examples/java/.env.yaml

This file was deleted.

119 changes: 0 additions & 119 deletions examples/java/README.md

This file was deleted.

Loading

0 comments on commit cab1c69

Please sign in to comment.