Skip to content

Commit

Permalink
UPSTREAM: <carry>: chore: add unittest workflow.
Browse files Browse the repository at this point in the history
Signed-off-by: Humair Khan <[email protected]>
  • Loading branch information
HumairAK committed Mar 10, 2024
1 parent 54e1724 commit 1f43a83
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/resources/unittests/application_default_credentials.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type": "service_account",
"project_id": "your-project-id",
"private_key_id": "your-private-key-id",
"private_key": "-----BEGIN PRIVATE KEY-----\nYour private key content\n-----END PRIVATE KEY-----\n",
"client_email": "[email protected]",
"client_id": "your-client-id",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://accounts.google.com/o/oauth2/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/[email protected]"
}
21 changes: 21 additions & 0 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Unit Tests
on:
pull_request:
workflow_dispatch:

env:
RESOURCES_DIR: ${{ github.workspace }}/.github/resources
jobs:
functest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.20.x'
- name: Run Unit Test
working-directory: ${{ github.workspace }}/backend/src
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ env.RESOURCES_DIR }}/unittests/application_default_credentials.json
run: go test ./...

0 comments on commit 1f43a83

Please sign in to comment.