|
| 1 | +--- |
| 2 | +version: 2 |
| 3 | +jobs: |
| 4 | + build: |
| 5 | + docker: |
| 6 | + - image: googleapis/nox:0.11.2 |
| 7 | + steps: |
| 8 | + - checkout |
| 9 | + - run: |
| 10 | + name: Decrypt credentials |
| 11 | + command: | |
| 12 | + if [ -n "$GOOGLE_APPLICATION_CREDENTIALS" ]; then |
| 13 | + apt-get update && apt-get install -y openssl |
| 14 | + openssl aes-256-cbc -d -a -k "$GOOGLE_CREDENTIALS_PASSPHRASE" \ |
| 15 | + -in /var/code/gcp/test_utils/credentials.json.enc \ |
| 16 | + -out "$GOOGLE_APPLICATION_CREDENTIALS" |
| 17 | + else |
| 18 | + echo "No credentials. System tests will not run." |
| 19 | + fi |
| 20 | + - run: |
| 21 | + name: Add GitHub public key to known hosts |
| 22 | + command: | |
| 23 | + mkdir -p ~/.ssh/ |
| 24 | + if [[ ! -f ~/.ssh/known_hosts ]] || ! grep "github.com" ~/.ssh/known_hosts; then |
| 25 | + echo " |
| 26 | + github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== |
| 27 | + " >> ~/.ssh/known_hosts |
| 28 | + fi |
| 29 | + - run: |
| 30 | + name: Declare target packages (changed packages and dependencies). |
| 31 | + command: | |
| 32 | + python3.6 test_utils/scripts/get_target_packages.py > ~/target_packages |
| 33 | + cat ~/target_packages |
| 34 | + - run: |
| 35 | + name: Run tests - google.cloud.core |
| 36 | + command: | |
| 37 | + if [[ -n $(grep core ~/target_packages) ]]; then |
| 38 | + nox -f core/nox.py |
| 39 | + fi |
| 40 | + - run: |
| 41 | + name: Run tests - google.cloud.bigquery |
| 42 | + command: | |
| 43 | + if [[ -n $(grep bigquery ~/target_packages) ]]; then |
| 44 | + nox -f bigquery/nox.py |
| 45 | + fi |
| 46 | + - run: |
| 47 | + name: Run tests - google.cloud.bigtable |
| 48 | + command: | |
| 49 | + if [[ -n $(grep bigtable ~/target_packages) ]]; then |
| 50 | + nox -f bigtable/nox.py |
| 51 | + fi |
| 52 | + - run: |
| 53 | + name: Run tests - google.cloud.datastore |
| 54 | + command: | |
| 55 | + if [[ -n $(grep datastore ~/target_packages) ]]; then |
| 56 | + nox -f datastore/nox.py |
| 57 | + fi |
| 58 | + - run: |
| 59 | + name: Run tests - google.cloud.dns |
| 60 | + command: | |
| 61 | + if [[ -n $(grep dns ~/target_packages) ]]; then |
| 62 | + nox -f dns/nox.py |
| 63 | + fi |
| 64 | + - run: |
| 65 | + name: Run tests - google.cloud.error_reporting |
| 66 | + command: | |
| 67 | + if [[ -n $(grep error_reporting ~/target_packages) ]]; then |
| 68 | + nox -f error_reporting/nox.py |
| 69 | + fi |
| 70 | + - run: |
| 71 | + name: Run tests - google.cloud.language |
| 72 | + command: | |
| 73 | + if [[ -n $(grep language ~/target_packages) ]]; then |
| 74 | + nox -f language/nox.py |
| 75 | + fi |
| 76 | + - run: |
| 77 | + name: Run tests - google.cloud.logging |
| 78 | + command: | |
| 79 | + if [[ -n $(grep logging ~/target_packages) ]]; then |
| 80 | + nox -f logging/nox.py |
| 81 | + fi |
| 82 | + - run: |
| 83 | + name: Run tests - google.cloud.monitoring |
| 84 | + command: | |
| 85 | + if [[ -n $(grep monitoring ~/target_packages) ]]; then |
| 86 | + nox -f monitoring/nox.py |
| 87 | + fi |
| 88 | + - run: |
| 89 | + name: Run tests - google.cloud.pubsub |
| 90 | + command: | |
| 91 | + if [[ -n $(grep pubsub ~/target_packages) ]]; then |
| 92 | + nox -f pubsub/nox.py |
| 93 | + fi |
| 94 | + - run: |
| 95 | + name: Run tests - google.cloud.resource_manager |
| 96 | + command: | |
| 97 | + if [[ -n $(grep resource_manager ~/target_packages) ]]; then |
| 98 | + nox -f resource_manager/nox.py |
| 99 | + fi |
| 100 | + - run: |
| 101 | + name: Run tests - google.cloud.runtimeconfig |
| 102 | + command: | |
| 103 | + if [[ -n $(grep runtimeconfig ~/target_packages) ]]; then |
| 104 | + nox -f runtimeconfig/nox.py |
| 105 | + fi |
| 106 | + - run: |
| 107 | + name: Run tests - google.cloud.spanner |
| 108 | + command: | |
| 109 | + if [[ -n $(grep spanner ~/target_packages) ]]; then |
| 110 | + nox -f spanner/nox.py |
| 111 | + fi |
| 112 | + - run: |
| 113 | + name: Run tests - google.cloud.speech |
| 114 | + command: | |
| 115 | + if [[ -n $(grep speech ~/target_packages) ]]; then |
| 116 | + nox -f speech/nox.py |
| 117 | + fi |
| 118 | + - run: |
| 119 | + name: Run tests - google.cloud.storage |
| 120 | + command: | |
| 121 | + if [[ -n $(grep storage ~/target_packages) ]]; then |
| 122 | + nox -f storage/nox.py |
| 123 | + fi |
| 124 | + - run: |
| 125 | + name: Run tests - google.cloud.translate |
| 126 | + command: | |
| 127 | + if [[ -n $(grep translate ~/target_packages) ]]; then |
| 128 | + nox -f translate/nox.py |
| 129 | + fi |
| 130 | + - run: |
| 131 | + name: Run tests - google.cloud.vision |
| 132 | + command: | |
| 133 | + if [[ -n $(grep vision ~/target_packages) ]]; then |
| 134 | + nox -f vision/nox.py |
| 135 | + fi |
| 136 | + - deploy: |
| 137 | + name: Update the docs |
| 138 | + command: nox -e docs |
| 139 | + - deploy: |
| 140 | + name: Push to PyPI (if this is a release tag). |
| 141 | + command: test_utils/scripts/circleci/twine_upload.sh |
| 142 | + working_directory: /var/code/gcp/ |
0 commit comments