From 357f4c310fe23023f66870c14e197f2ced63d2b0 Mon Sep 17 00:00:00 2001 From: Gil LaHaye Date: Sun, 3 Dec 2023 21:08:11 -0800 Subject: [PATCH] Use dotnet user secrets to propagate Github secrets to integration test workflow --- .../copilot-run-integration-tests.yml | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/copilot-run-integration-tests.yml b/.github/workflows/copilot-run-integration-tests.yml index 568002b13..4579f4ccd 100644 --- a/.github/workflows/copilot-run-integration-tests.yml +++ b/.github/workflows/copilot-run-integration-tests.yml @@ -22,12 +22,22 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Run integration tests + + - name: Configure test environment + working-directory: integration-tests env: - BaseServerUrl: "https://${{inputs.BACKEND_HOST}}.azurewebsites.net/" - TenantID: ${{secrets.COPILOT_CHAT_TEST_TENANT_ID}} - ClientID: ${{secrets.COPILOT_CHAT_TEST_APP_AAD_WEBAPP_CLIENT_ID}} - BackendClientID: ${{secrets.COPILOT_CHAT_TEST_APP_AAD_WEBAPI_CLIENT_ID}} + TenantId: ${{ secrets.COPILOT_CHAT_TEST_TENANT_ID }} + WebApiClientId: ${{ secrets.COPILOT_CHAT_TEST_APP_AAD_WEBAPI_CLIENT_ID }} + WebAppClientId: ${{ secrets.COPILOT_CHAT_TEST_APP_AAD_WEBAPP_CLIENT_ID }} Username: ${{secrets.COPILOT_CHAT_TEST_USER_ACCOUNT1}} Password: ${{secrets.COPILOT_CHAT_TEST_USER_PASSWORD1}} - run: dotnet test --logger trx -e Authority="https://login.microsoftonline.com/$env:TenantID" -e Scopes="openid, offline_access, profile, api://$env:BackendClientID/access_as_user" + run: | + dotnet user-secrets set "BaseServerUrl" "https://${{inputs.BACKEND_HOST}}.azurewebsites.net/" + dotnet user-secrets set "Authority" "https://login.microsoftonline.com/$env:TenantID" + dotnet user-secrets set "ClientID" "$env:WebAppClientId" + dotnet user-secrets set "Scopes" "openid, offline_access, profile, api://$env:WebApiClientId/access_as_user" + dotnet user-secrets set "Username" "$env:Username" + dotnet user-secrets set "Password" "$env:Password" + + - name: Run integration tests + run: dotnet test --logger trx