From 90ca5f1342c6c7dbf34f370d5b044e471c30a9a0 Mon Sep 17 00:00:00 2001 From: Marin Minnerly Date: Wed, 25 Oct 2023 20:16:56 -0700 Subject: [PATCH] Re-enable VPN --- .github/workflows/ci.yml | 130 +++++++++++++++++++-------------------- 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e94c4c3..372eb89a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,65 +103,65 @@ jobs: - name: Build place file run: rojo build dev.project.json -o studio-tests.rbxl - # - name: Install Mullvad - # run: choco install mullvad-app - - # - name: Update path with Mullvad executable - # shell: bash - # run: | - # BIN="/c/Program Files/Mullvad VPN/resources" - # echo "$BIN" >> $GITHUB_PATH - - # - name: Login to Mullvad account - # shell: bash - # run: mullvad account login ${{ secrets.MULLVAD_ACCOUNT }} - - # - name: Set server to connect to - # shell: bash - # run: mullvad relay set location us-sjc-wg-001 - - # - name: Export IP before connecting to VPN - # shell: bash - # run: | - # ip=$(curl -s https://httpbin.org/ip | jq -r .origin) - # echo "Current IP address: $ip" - # echo "RUNNER_IP=$ip" >> $GITHUB_ENV - - # - name: Connect to VPN - # shell: bash - # run: mullvad connect - - # - name: Export device name - # shell: bash - # run: | - # deviceName=$(mullvad account get | grep "Device name" | cut -d : -f 2 | xargs) - # echo "Device name: $deviceName" - # echo "DEVICE_NAME=$deviceName" >> $GITHUB_ENV - - # - name: Poll for IP change - # uses: nick-fields/retry@v2.8.3 - # with: - # max_attempts: 5 - # timeout_minutes: 2 - # retry_wait_seconds: 2 - # shell: bash - # command: | - # ip=$(curl -s https://httpbin.org/ip | jq -r .origin) - - # echo "Original IP: ${{ env.RUNNER_IP }}" - # echo "Current IP: $ip" - - # if [[ $ip != "" && "${{ env.RUNNER_IP }}" != "$ip" ]]; then - # echo "IP changed, assuming we're connected now to the VPN" - # exit 0 - # else - # echo "IP has not changed yet. Retrying...." - # exit 1 - # fi - - # - name: Log Mullvad status - # shell: bash - # run: mullvad status -v + - name: Install Mullvad + run: choco install mullvad-app + + - name: Update path with Mullvad executable + shell: bash + run: | + BIN="/c/Program Files/Mullvad VPN/resources" + echo "$BIN" >> $GITHUB_PATH + + - name: Login to Mullvad account + shell: bash + run: mullvad account login ${{ secrets.MULLVAD_ACCOUNT }} + + - name: Set server to connect to + shell: bash + run: mullvad relay set location us-sjc-wg-001 + + - name: Export IP before connecting to VPN + shell: bash + run: | + ip=$(curl -s https://httpbin.org/ip | jq -r .origin) + echo "Current IP address: $ip" + echo "RUNNER_IP=$ip" >> $GITHUB_ENV + + - name: Connect to VPN + shell: bash + run: mullvad connect + + - name: Export device name + shell: bash + run: | + deviceName=$(mullvad account get | grep "Device name" | cut -d : -f 2 | xargs) + echo "Device name: $deviceName" + echo "DEVICE_NAME=$deviceName" >> $GITHUB_ENV + + - name: Poll for IP change + uses: nick-fields/retry@v2.8.3 + with: + max_attempts: 5 + timeout_minutes: 2 + retry_wait_seconds: 2 + shell: bash + command: | + ip=$(curl -s https://httpbin.org/ip | jq -r .origin) + + echo "Original IP: ${{ env.RUNNER_IP }}" + echo "Current IP: $ip" + + if [[ $ip != "" && "${{ env.RUNNER_IP }}" != "$ip" ]]; then + echo "IP changed, assuming we're connected now to the VPN" + exit 0 + else + echo "IP has not changed yet. Retrying...." + exit 1 + fi + + - name: Log Mullvad status + shell: bash + run: mullvad status -v - name: List tokens shell: bash @@ -197,12 +197,12 @@ jobs: - name: Run tests run: run-in-roblox --place studio-tests.rbxl --script tests/init.server.lua - # - name: Disconnect from VPN - # if: always() - # shell: bash - # run: | - # mullvad disconnect - # mullvad account revoke-device "${{ env.DEVICE_NAME }}" + - name: Disconnect from VPN + if: always() + shell: bash + run: | + mullvad disconnect + mullvad account revoke-device "${{ env.DEVICE_NAME }}" - name: Dump logs uses: actions/upload-artifact@v3