Skip to content

[ Architecture] GitHub Action: Integration tests for Google Earth Engine #48

@priyadam

Description

@priyadam

Prereqs:

  • Use the Earth Engine JavaScript API via Node.js.
  • Secret: EARTHENGINE
  • Install @google/earthengine and google-auth-library.

Tasks:

  • initialize a test file

  • Install dependencies

    • In bash:

    npm install --save-dev jest
    npm install @google/earthengine google-auth-library

    • in package.json

    "scripts": {
    "test:integration": "jest tests/gee.integration.test.js"
    }

  • GitHub Action

    • Create a workflow file
    • Debug the following:
      name: GEE JS Integration Tests

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
integration-tests:
runs-on: ubuntu-latest

env:
  GEE_PRIVATE_KEY_PATH: ${{ github.workspace }}/privatekey.json

steps:
  - name: Checkout repository
    uses: actions/checkout@v3

  - name: Set up Node.js
    uses: actions/setup-node@v3
    with:
      node-version: '20'

  - name: Install dependencies
    run: npm install

  - name: Set up GEE private key
    run: echo "${{ secrets.GEE_PRIVATE_KEY_JSON }}" > privatekey.json

  - name: Run GEE integration tests
    run: npm run test:integration

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions