fix: Add keepalive. #48
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: ci | |
on: | |
pull_request: | |
branches: [master] | |
# Cancel old PR builds when pushing new commits. | |
concurrency: | |
group: build-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
wireguard-vpn: | |
strategy: | |
matrix: | |
# node: [2, 3, 4, 5, 6, 7, 8, 9] | |
node: [2, 3] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup wireguard | |
run: | | |
sudo apt-get -y --no-install-recommends install wireguard | |
sudo cp .github/buildfarm/wg0-${{ matrix.node }}.conf /etc/wireguard/wg0.conf | |
sudo systemctl enable [email protected] | |
sudo systemctl start [email protected] || (sudo systemctl status [email protected] && false) | |
sudo systemctl start ssh | |
mkdir "$HOME/.ssh" | |
cp .github/buildfarm/authorized_keys "$HOME/.ssh/" | |
- name: Wait for VPN to be up | |
run: | | |
ifconfig wg0 | |
sudo wg show | |
for i in `seq 0 9`; do | |
if ping -c1 10.100.0.1; then break; fi | |
sleep 1 | |
done | |
ping -c1 10.100.0.1 | |
sudo wg show | |
ip route | |
- name: Start server | |
if: matrix.node == 2 | |
run: docker run --rm -i --network host -v "$PWD/.github/buildfarm/server-${{ matrix.node }}.yml:/app/build_buildfarm/examples/config.minimal.yml" toxchat/buildfarm-server | |
- name: Pull latest worker image | |
run: docker pull toxchat/buildfarm-worker | |
- name: Test connectivity to other nodes | |
run: | | |
ping -c1 10.100.0.1 # server | |
ping -c1 10.100.0.2 # either self or some other node | |
ping -c1 10.100.0.3 # either some other node or self | |
- name: Start worker | |
run: docker run --rm -i --network host -v "$PWD/.github/buildfarm/worker-${{ matrix.node }}.yml:/app/build_buildfarm/examples/config.minimal.yml" toxchat/buildfarm-worker |