This repository has been archived by the owner on Dec 16, 2024. It is now read-only.
Update CI #386
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: Node.js CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 14.x | |
- name: Install dependencies | |
run: npm ci | |
- name: Check format | |
run: npm run check-format | |
- name: Run build | |
run: npm run build | |
- name: Setup WireGuard | |
run: | | |
set -o errexit -o pipefail -o nounset | |
sudo apt-get update | |
sudo apt-get install -y wireguard-tools | |
sudo cat << EOL > wg0-client.conf | |
[Interface] | |
PrivateKey = ${{ secrets.WG_CLIENT_PRIVATE_KEY }} | |
Address = 10.0.0.2/32 | |
[Peer] | |
PublicKey = ${{ secrets.WG_SERVER_PUBLIC_KEY }} | |
Endpoint = ${{ secrets.WG_SERVER_IP }}:${{ secrets.WG_SERVER_PORT }} | |
AllowedIPs = 0.0.0.0/0 | |
EOL | |
sudo wg-quick up ./wg0-client.conf | |
# Check if the tunnel is up | |
if sudo wg show wg0-client | grep -q "peer: ${{ secrets.WG_SERVER_PUBLIC_KEY }}"; then | |
echo "Connected!" | |
else | |
echo "Connection failed!" | |
exit 1 | |
fi | |
- name: Run test | |
run: npm test | |
env: | |
BLOCKFROST_PROJECT_ID: ${{ secrets.BLOCKFROST_PROJECT_ID }} |