Skip to content

Commit

Permalink
chore: replace deprecated github action commands. (#693)
Browse files Browse the repository at this point in the history
1. Github action shows warning:
``The `set-output` command is deprecated and will be disabled soon. ``
sample [log](https://github.com/GoogleCloudPlatform/cloud-spanner-r2dbc/actions/runs/5157962559)
This change follows the upgrade guide and upgrades to using Environment Files

2. This pr also addresses `Node.js 12 actions are deprecated` warning on unit test and integration tests.
Github action announcement:
https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/

    - For 'google-github-actions/auth@v1' and 'google-github-actions/setup-gcloud@v1', follow example [here](https://github.com/google-github-actions/setup-gcloud#service-account-key-json)
  • Loading branch information
zhumin8 authored Jun 6, 2023
1 parent aa99ea6 commit 1d9cc88
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/integrationTests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,31 @@ jobs:
integrationTests:
if: github.repository == 'GoogleCloudPlatform/cloud-spanner-r2dbc'
runs-on: ubuntu-20.04
permissions:
contents: 'read'
id-token: 'write'
strategy:
fail-fast: true
steps:
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d' --utc)"
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
run: echo "date=$(date +'%Y-%m-%d' --utc)" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 11
- uses: actions/cache@v2
distribution: 'temurin'
- uses: actions/cache@v3
id: mvn-cache
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-unified-${{ steps.date.outputs.date }}
- name: Set Up Authentication
uses: google-github-actions/auth@v0.4.0
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.CLOUD_SPANNER_R2DBC_CI_SA_KEY }}
- name: Setup gcloud
uses: google-github-actions/setup-gcloud@v0.2.1
uses: google-github-actions/setup-gcloud@v1
with:
version: latest
project_id: cloud-spanner-r2dbc-ci
Expand Down Expand Up @@ -96,7 +100,7 @@ jobs:
- name: Archive logs
if: always()
continue-on-error: true
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: Integration Test Logs - ${{ matrix.it}}
path: |
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/unitTests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ jobs:
steps:
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d' --utc)"
run: echo "date=$(date +'%Y-%m-%d' --utc)" >> $GITHUB_OUTPUT

- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-java@v1
- uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'

- uses: actions/cache@v2
- uses: actions/cache@v3
id: mvn-cache
with:
path: ~/.m2/repository
Expand Down Expand Up @@ -80,7 +81,7 @@ jobs:
- name: Archive logs
if: always()
continue-on-error: true
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: Unit Test Logs - Java ${{ matrix.java }}
path: |
Expand Down

0 comments on commit 1d9cc88

Please sign in to comment.