diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 6d10118b3..944a6c15b 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -15,6 +15,7 @@ env: GDRIVE_CREDENTIALS_DATA: ${{ secrets.GDRIVE_CREDENTIALS_DATA }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + GS_CREDS_JSON: ${{ secrets.GS_CREDS_JSON }} jobs: lint: @@ -52,6 +53,11 @@ jobs: run: | git config --global user.email "dvctester@example.com" git config --global user.name "DVC Tester" + - name: setup gs creds + shell: bash + run: | + mkdir -p scripts/ci + echo "$GS_CREDS_JSON" > scripts/ci/gcp-creds.json - name: run tests run: python -m tests -ra --cov-report=xml --cov-report=term - name: upload coverage report diff --git a/tests/remotes/gs.py b/tests/remotes/gs.py index 3f8e68acf..431e41146 100644 --- a/tests/remotes/gs.py +++ b/tests/remotes/gs.py @@ -25,8 +25,6 @@ os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = TEST_GCP_CREDS_FILE class GCP(Base, CloudURLInfo): @staticmethod def should_test(): - from subprocess import CalledProcessError, check_output - do_test = env2bool("DVC_TEST_GCP", undefined=None) if do_test is not None: return do_test @@ -34,18 +32,6 @@ class GCP(Base, CloudURLInfo): if not os.path.exists(TEST_GCP_CREDS_FILE): return False - try: - check_output( - [ - "gcloud", - "auth", - "activate-service-account", - "--key-file", - TEST_GCP_CREDS_FILE, - ] - ) - except (CalledProcessError, OSError): - return False return True @cached_property