Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add webhooks integration tests for organization and repository #161

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,20 @@ jobs:
- name: Build GARM
run: make build

- name: Set up ngrok
id: ngrok
uses: gabriel-samfira/[email protected]
with:
ngrok_authtoken: ${{ secrets.NGROK_AUTH_TOKEN }}
port: 9997
tunnel_type: http

- name: Setup GARM
run: ./test/integration/scripts/setup-garm.sh
env:
GH_OAUTH_TOKEN: ${{ secrets.GH_OAUTH_TOKEN }}
CREDENTIALS_NAME: test-garm-creds
GARM_BASE_URL: ${{ steps.ngrok.outputs.tunnel-url }}

- name: Generate secrets
run: |
Expand All @@ -46,14 +55,6 @@ jobs:
echo "REPO_WEBHOOK_SECRET=$REPO_WEBHOOK_SECRET" >> $GITHUB_ENV
echo "ORG_WEBHOOK_SECRET=$ORG_WEBHOOK_SECRET" >> $GITHUB_ENV

- name: Set up ngrok
id: ngrok
uses: gabriel-samfira/[email protected]
with:
ngrok_authtoken: ${{ secrets.NGROK_AUTH_TOKEN }}
port: 9997
tunnel_type: http

- name: Create logs directory
if: always()
run: sudo mkdir -p /artifacts-logs && sudo chmod 777 /artifacts-logs
Expand All @@ -72,6 +73,7 @@ jobs:
ORG_NAME: gsamfira
REPO_NAME: garm-testing
CREDENTIALS_NAME: test-garm-creds
WORKFLOW_FILE_NAME: test.yml
GH_TOKEN: ${{ secrets.GH_OAUTH_TOKEN }}

- name: Show GARM logs
Expand Down
6 changes: 4 additions & 2 deletions test/integration/config/config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[default]
callback_url = "http://${GARM_METADATA_IP}:9997/api/v1/callbacks/status"
metadata_url = "http://${GARM_METADATA_IP}:9997/api/v1/metadata"
callback_url = "${GARM_BASE_URL}/api/v1/callbacks/status"
metadata_url = "${GARM_BASE_URL}/api/v1/metadata"
webhook_url = "${GARM_BASE_URL}/webhooks"
enable_webhook_management = true

[metrics]
enable = true
Expand Down
Loading