Skip to content

Commit

Permalink
Run msgraph tests on cloud runner
Browse files Browse the repository at this point in the history
  • Loading branch information
manicminer committed Jan 31, 2022
1 parent 47075b4 commit 91a4ba0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/msgraph-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ on:
- "msgraph/**.go"
- ".github/workflows/msgraph-tests.yml"

permissions:
contents: 'read'
id-token: 'write'

jobs:
test-msgraph:
runs-on: self-hosted
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
Expand All @@ -23,5 +27,10 @@ jobs:

- name: Test
run: go test -count=1 -race -v ./msgraph
env:
AZURE_ENVIRONMENT: ${{ secrets.AZURE_ENVIRONMENT }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
TENANT_ID: ${{ secrets.TENANT_ID }}
TENANT_DOMAIN: ${{ secrets.TENANT_DOMAIN }}

# vim: set ts=2 sts=2 sw=2 et:
5 changes: 5 additions & 0 deletions internal/test/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ var (
clientCertPassword = os.Getenv("CLIENT_CERTIFICATE_PASSWORD")
clientSecret = os.Getenv("CLIENT_SECRET")
environment = os.Getenv("AZURE_ENVIRONMENT")
idTokenRequestUrl = os.Getenv("ACTIONS_ID_TOKEN_REQUEST_URL")
idTokenRequestToken = os.Getenv("ACTIONS_ID_TOKEN_REQUEST_TOKEN")
retryMax = envDefault("RETRY_MAX", "14")
)

Expand All @@ -57,9 +59,12 @@ func NewConnection(tokenVersion auth.TokenVersion) *Connection {
ClientCertPath: clientCertificatePath,
ClientCertPassword: clientCertPassword,
ClientSecret: clientSecret,
IDTokenRequestURL: idTokenRequestUrl,
IDTokenRequestToken: idTokenRequestToken,
EnableClientCertAuth: true,
EnableClientSecretAuth: true,
EnableAzureCliToken: true,
EnableGitHubOIDCAuth: true,
},
DomainName: tenantDomain,
}
Expand Down

0 comments on commit 91a4ba0

Please sign in to comment.