Skip to content

Commit

Permalink
Merge pull request #286 from gabriel-samfira/replace-ngrok
Browse files Browse the repository at this point in the history
Replace ngrok
  • Loading branch information
gabriel-samfira authored Aug 12, 2024
2 parents 237afdb + e1e4621 commit fc32978
Showing 1 changed file with 35 additions and 9 deletions.
44 changes: 35 additions & 9 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,41 @@ jobs:
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get -qq update && sudo apt-get -qq install -y apg coreutils make
- name: Set up ngrok
id: ngrok
uses: gabriel-samfira/ngrok-tunnel-action@v1.1
with:
ngrok_authtoken: ${{ secrets.NGROK_AUTH_TOKEN }}
port: 9997
tunnel_type: http
- name: Set up localshow tunnel
shell: bash
run: |
mkdir -p /home/runner/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > /home/runner/.ssh/ssh_key
sudo chown -R runner:runner /home/runner/.ssh
sudo chmod 500 /home/runner/.ssh
sudo chmod 400 /home/runner/.ssh/ssh_key
SUBDOMAIN=$(apg -a 0 -M l -m 12 -n 1)
echo "::add-mask::$SUBDOMAIN"
BASE_URL="${{ secrets.TUNNEL_BASE_URL }}"
GARM_BASE_URL="https://$SUBDOMAIN.$BASE_URL"
echo "::add-mask::$GARM_BASE_URL"
echo "GARM_BASE_URL=$GARM_BASE_URL" >> $GITHUB_ENV
cat <<EOF | sudo tee /etc/systemd/system/localshow-tunnel.service
[Unit]
Description=Localshow tunnel
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/ssh -q -i /home/runner/.ssh/ssh_key -N -n -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -R $SUBDOMAIN:80:127.0.0.1:9997 $BASE_URL
Restart=always
User=runner
[Install]
WantedBy=default.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable localshow-tunnel
sudo systemctl start localshow-tunnel
- name: Generate secrets
run: |
Expand All @@ -57,7 +85,6 @@ jobs:
set -o errexit
make integration 2>&1
env:
GARM_BASE_URL: ${{ steps.ngrok.outputs.tunnel-url }}
ORG_NAME: gsamfira
REPO_NAME: garm-testing
CREDENTIALS_NAME: test-garm-creds
Expand Down Expand Up @@ -87,7 +114,6 @@ jobs:
sudo systemctl stop garm@runner || true
go run ./test/integration/gh_cleanup/main.go || true
env:
GARM_BASE_URL: ${{ steps.ngrok.outputs.tunnel-url }}
ORG_NAME: gsamfira
REPO_NAME: garm-testing
GH_TOKEN: ${{ secrets.GH_OAUTH_TOKEN }}

0 comments on commit fc32978

Please sign in to comment.