|
| 1 | +name: Build under Ubuntu |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + - 1.x-dev |
| 8 | + |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v3 |
| 16 | + with: |
| 17 | + submodules: 'true' |
| 18 | + |
| 19 | + - uses: actions/setup-java@v3 |
| 20 | + with: |
| 21 | + java-version: 8 |
| 22 | + distribution: zulu |
| 23 | + |
| 24 | + # This operation is specific to `gcloud-java` repository only. |
| 25 | + - name: Decrypt the credentials for the Spine-Dev service account |
| 26 | + run: ./config/scripts/decrypt.sh "$SPINE_DEV_KEY" ./.github/keys/spine-dev.json.gpg ./spine-dev.json |
| 27 | + env: |
| 28 | + SPINE_DEV_KEY: ${{ secrets.SPINE_DEV_KEY }} |
| 29 | + |
| 30 | + # The OS-managed Google Cloud SDK does not provide a Datastore emulator. |
| 31 | + - name: Remove the OS-managed Google Cloud SDK |
| 32 | + run: sudo apt-get remove google-cloud-sdk |
| 33 | + |
| 34 | + - name: Install Google Cloud SDK utility |
| 35 | + run: chmod +x ./scripts/install-gcloud.sh && ./scripts/install-gcloud.sh |
| 36 | + |
| 37 | + # Appends the `gcloud` utility to the PATH for this particular terminal session. |
| 38 | + - name: Install the Datastore emulator and Cloud Beta tools |
| 39 | + run: > |
| 40 | + source ~/google-cloud-sdk/path.bash.inc |
| 41 | + && gcloud components install cloud-datastore-emulator --quiet |
| 42 | + && gcloud components install beta --quiet |
| 43 | +
|
| 44 | + # Appends the `gcloud` utility to the PATH for this particular terminal session. |
| 45 | + - name: Start the Datastore emulator |
| 46 | + run: > |
| 47 | + source ~/google-cloud-sdk/path.bash.inc |
| 48 | + && ./scripts/start-datastore.sh & |
| 49 | +
|
| 50 | + - name: Build project and run tests |
| 51 | + run: > |
| 52 | + source ~/google-cloud-sdk/path.bash.inc |
| 53 | + && ./gradlew build --stacktrace |
0 commit comments