Skip to content

Fix ip manipulation and update test files #246

Fix ip manipulation and update test files

Fix ip manipulation and update test files #246

Workflow file for this run

name: Test
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
strategy:
matrix:
node_version: [ 16.x, 17.x, 18.x, 19.x ]
os: [ ubuntu, macos ]
runs-on: ${{ matrix.os }}-latest
name: "Test on ${{ matrix.os }} with Node ${{ matrix.node_version }}"
steps:
- uses: actions/checkout@v3
name: Checkout
- uses: actions/setup-node@v3
name: Setup Node.js
with:
node-version: ${{ matrix.node_version }}
- name: Install dependencies
run: |
npm install --no-save
sudo npm install -g ts-node typescript mocha
- name: Setup Go environment
if: matrix.os == 'macos'
uses: actions/setup-go@v4.1.0
- name: "Start wireguard interface (MacOS)"
if: matrix.os == 'macos'
run: |
cd ..
git clone https://git.zx2c4.com/wireguard-go
cd wireguard-go
echo "WG_INETRFACE=utun15" >> $GITHUB_ENV
go build -v -o "wireguard-go"
sudo ./wireguard-go utun15
- name: Test
run: |
tsc --build --clean
tsc --build
sudo -E mocha ./
- name: Upload generate interface
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}_${{ matrix.node_version }}
path: "*.addrs.json"
build:
needs: test
strategy:
matrix:
os:
- windows
- macos
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v3
name: Code checkout
with:
submodules: true
# Install basic tools
- uses: actions/setup-node@v3
name: Setup node.js
with:
node-version: 18.x
registry-url: https://registry.npmjs.org/
- run: npm install --no-save --ignore-scripts
- run: npm run prebuildify -- -v
- name: Upload generate interface
uses: actions/upload-artifact@v3
with:
retention-days: 7
name: prebuilds_${{ matrix.os }}
path: "prebuilds/**"
pack_package:
needs: build
runs-on: ubuntu-latest
name: Pack npm package
env:
PACKAGE_VERSION: ${{ github.ref }}
steps:
- uses: actions/checkout@v3
name: Code checkout
with:
submodules: true
- name: Ubuntu dependecies
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt install -y binutils-multiarch gcc-*aarch64-linux-gnu gcc-*aarch64-linux-gnu-base g++-*aarch64-linux-gnu libc6-arm64-cross
# Install basic tools
- uses: actions/setup-node@v3
name: Setup node.js
with:
node-version: 18.x
registry-url: https://registry.npmjs.org/
- name: Download all artefacts
uses: actions/download-artifact@v3
with:
path: ./prebuilds
- run: npm install --no-save
- run: npm pack
- name: Upload npm package
uses: actions/upload-artifact@v3
with:
name: Package_Pack
path: "*.tgz"