Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: willdavsmith <willdavsmith@gmail.com>
  • Loading branch information
willdavsmith committed Mar 6, 2024
1 parent 61512df commit cb946bc
Showing 1 changed file with 34 additions and 28 deletions.
62 changes: 34 additions & 28 deletions .github/workflows/functional-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
if: github.event_name == 'workflow_run'
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_RAD_CI_BOT_PAT }}
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const payload = context.payload.workflow_run;
let fs = require('fs');
Expand All @@ -125,7 +125,7 @@ jobs:
if: github.event_name == 'repository_dispatch'
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_RAD_CI_BOT_PAT }}
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const clientPayload = context.payload.client_payload;
if (clientPayload && clientPayload.event_type === `de-functional-test`) {
Expand Down Expand Up @@ -168,7 +168,7 @@ jobs:
if: env.PR_NUMBER != ''
continue-on-error: true
with:
GH_RAD_CI_BOT_PAT: ${{ steps.get_installation_token.outputs.token }}
GITHUB_TOKEN: ${{ steps.get_installation_token.outputs.token }}
header: teststatus-${{ github.run_id }}
number: ${{ env.PR_NUMBER }}
hide: true
Expand Down Expand Up @@ -203,17 +203,17 @@ jobs:
</details>
## Test Status
- name:
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_RAD_CI_BOT_PAT }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: marocchino/sticky-pull-request-comment@v2
if: env.PR_NUMBER != ''
continue-on-error: true
with:
GH_RAD_CI_BOT_PAT: ${{ steps.get_installation_token.outputs.token }}
GITHUB_TOKEN: ${{ steps.get_installation_token.outputs.token }}
header: teststatus-${{ github.run_id }}
number: ${{ env.PR_NUMBER }}
append: true
Expand All @@ -235,7 +235,7 @@ jobs:
if: success() && env.PR_NUMBER != ''
continue-on-error: true
with:
GH_RAD_CI_BOT_PAT: ${{ steps.get_installation_token.outputs.token }}
GITHUB_TOKEN: ${{ steps.get_installation_token.outputs.token }}
header: teststatus-${{ github.run_id }}
number: ${{ env.PR_NUMBER }}
append: true
Expand All @@ -245,7 +245,7 @@ jobs:
if: failure() && env.PR_NUMBER != ''
continue-on-error: true
with:
GH_RAD_CI_BOT_PAT: ${{ steps.get_installation_token.outputs.token }}
GITHUB_TOKEN: ${{ steps.get_installation_token.outputs.token }}
header: teststatus-${{ github.run_id }}
number: ${{ env.PR_NUMBER }}
append: true
Expand All @@ -255,7 +255,7 @@ jobs:
if: env.PR_NUMBER != ''
continue-on-error: true
with:
GH_RAD_CI_BOT_PAT: ${{ steps.get_installation_token.outputs.token }}
GITHUB_TOKEN: ${{ steps.get_installation_token.outputs.token }}
header: teststatus-${{ github.run_id }}
number: ${{ env.PR_NUMBER }}
append: true
Expand All @@ -278,7 +278,7 @@ jobs:
if: success() && env.PR_NUMBER != ''
continue-on-error: true
with:
GH_RAD_CI_BOT_PAT: ${{ steps.get_installation_token.outputs.token }}
GITHUB_TOKEN: ${{ steps.get_installation_token.outputs.token }}
header: teststatus-${{ github.run_id }}
number: ${{ env.PR_NUMBER }}
append: true
Expand All @@ -288,7 +288,7 @@ jobs:
if: failure() && env.PR_NUMBER != ''
continue-on-error: true
with:
GH_RAD_CI_BOT_PAT: ${{ steps.get_installation_token.outputs.token }}
GITHUB_TOKEN: ${{ steps.get_installation_token.outputs.token }}
header: teststatus-${{ github.run_id }}
number: ${{ env.PR_NUMBER }}
append: true
Expand Down Expand Up @@ -322,6 +322,12 @@ jobs:
outputs:
test_status: ${{ steps.report_test_status.outputs.test_status }}
steps:
- name: Login as the GitHub App
uses: tibdex/github-app-token@v1
id: get_installation_token
with:
app_id: ${{ secrets.FUNCTIONAL_TEST_APP_ID }}
private_key: ${{ secrets.FUNCTIONAL_TEST_APP_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -360,17 +366,17 @@ jobs:
uses: azure/login@v1
with:
creds: '{"clientId":"${{ secrets.INTEGRATION_TEST_SP_APP_ID }}","clientSecret":"${{ secrets.INTEGRATION_TEST_SP_PASSWORD }}","subscriptionId":"${{ secrets.INTEGRATION_TEST_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.INTEGRATION_TEST_TENANT_ID }}"}'
# - name: Create azure resource group - ${{ env.AZURE_TEST_RESOURCE_GROUP }}
# run: |
# current_time=$(date +%s)
# az group create \
# --location ${{ env.AZURE_LOCATION }} \
# --name $RESOURCE_GROUP \
# --subscription ${{ secrets.INTEGRATION_TEST_SUBSCRIPTION_ID }} \
# --tags creationTime=$current_time
# while [ $(az group exists --name $RESOURCE_GROUP) = false ]; do sleep 2; done
# env:
# RESOURCE_GROUP: ${{ env.AZURE_TEST_RESOURCE_GROUP }}
- name: Create azure resource group - ${{ env.AZURE_TEST_RESOURCE_GROUP }}
run: |
current_time=$(date +%s)
az group create \
--location ${{ env.AZURE_LOCATION }} \
--name $RESOURCE_GROUP \
--subscription ${{ secrets.INTEGRATION_TEST_SUBSCRIPTION_ID }} \
--tags creationTime=$current_time
while [ $(az group exists --name $RESOURCE_GROUP) = false ]; do sleep 2; done
env:
RESOURCE_GROUP: ${{ env.AZURE_TEST_RESOURCE_GROUP }}
- uses: azure/setup-helm@v3
with:
version: ${{ env.HELM_VER }}
Expand All @@ -385,7 +391,7 @@ jobs:
# AZURE_OIDC_ISSUER
eval "export $(echo "${{ secrets.FUNCTEST_AZURE_OIDC_JSON }}" | jq -r 'to_entries | map("\(.key)=\(.value)") | @sh')"
AUTHKEY=$(echo -n "${{ github.actor }}:${{ secrets.GH_RAD_CI_BOT_PAT }}" | base64)
AUTHKEY=$(echo -n "${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}" | base64)
echo "{\"auths\":{\"ghcr.io\":{\"auth\":\"${AUTHKEY}\"}}}" > "./ghcr_secret.json"
# Create KinD cluster with OIDC Issuer keys
Expand Down Expand Up @@ -442,7 +448,7 @@ jobs:
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_RAD_CI_BOT_PAT }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install Radius
run: |
export PATH=$GITHUB_WORKSPACE/bin:$PATH
Expand Down Expand Up @@ -558,7 +564,7 @@ jobs:
if: success() && env.PR_NUMBER != ''
continue-on-error: true
with:
GH_RAD_CI_BOT_PAT: ${{ steps.get_installation_token.outputs.token }}
GITHUB_TOKEN: ${{ steps.get_installation_token.outputs.token }}
header: teststatus-${{ github.run_id }}
number: ${{ env.PR_NUMBER }}
append: true
Expand All @@ -568,7 +574,7 @@ jobs:
if: failure() && env.PR_NUMBER != ''
continue-on-error: true
with:
GH_RAD_CI_BOT_PAT: ${{ steps.get_installation_token.outputs.token }}
GITHUB_TOKEN: ${{ steps.get_installation_token.outputs.token }}
header: teststatus-${{ github.run_id }}
number: ${{ env.PR_NUMBER }}
append: true
Expand All @@ -578,7 +584,7 @@ jobs:
if: cancelled() && env.PR_NUMBER != ''
continue-on-error: true
with:
GH_RAD_CI_BOT_PAT: ${{ steps.get_installation_token.outputs.token }}
GITHUB_TOKEN: ${{ steps.get_installation_token.outputs.token }}
header: teststatus-${{ github.run_id }}
number: ${{ env.PR_NUMBER }}
append: true
Expand Down Expand Up @@ -628,7 +634,7 @@ jobs:
- name: Create failure issue for failing scheduled run
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_RAD_CI_BOT_PAT }}
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.create({
...context.repo,
Expand Down

0 comments on commit cb946bc

Please sign in to comment.