Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4.1.0 to 5.0.0. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v4.1.0...v5.0.0) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
154 lines
3.8 KiB
YAML
154 lines
3.8 KiB
YAML
name: Test
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
linux_test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node_version: [ 16.x, 17.x, 18.x, 19.x, 20.x ]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
name: Checkout
|
|
|
|
- uses: actions/setup-node@v4
|
|
name: Setup Node.js
|
|
with:
|
|
node-version: ${{ matrix.node_version }}
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
sudo apt update
|
|
sudo apt install -y binutils-multiarch gcc-*aarch64-linux-gnu gcc-*aarch64-linux-gnu-base g++-*aarch64-linux-gnu libc6-arm64-cross
|
|
npm install --no-save --ignore-scripts
|
|
|
|
- name: Test
|
|
run: npm run prebuildify -- -v && sudo -E ./node_modules/.bin/mocha ./src
|
|
|
|
- name: Upload generate interface
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: addrs_${{ runner.os }}_${{ matrix.node_version }}
|
|
path: "*.addrs.json"
|
|
|
|
- name: Upload prebuilds interface
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
retention-days: 7
|
|
name: prebuilds_${{ runner.os }}
|
|
path: "prebuilds/**"
|
|
|
|
macos_test:
|
|
runs-on: macos-latest
|
|
strategy:
|
|
matrix:
|
|
node_version: [ 16.x, 17.x, 18.x, 19.x, 20.x ]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
name: Checkout
|
|
|
|
- uses: actions/setup-node@v4
|
|
name: Setup Node.js
|
|
with:
|
|
node-version: ${{ matrix.node_version }}
|
|
|
|
- name: Setup Go environment
|
|
uses: actions/setup-go@v5.0.0
|
|
|
|
- name: Setup wireguard-go
|
|
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: Install dependencies
|
|
run: npm install --no-save --ignore-scripts
|
|
|
|
- name: Test
|
|
run: npm run prebuildify -- -v && sudo -E ./node_modules/.bin/mocha ./src
|
|
|
|
- name: Upload generate interface
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: addrs_${{ runner.os }}_${{ matrix.node_version }}
|
|
path: "*.addrs.json"
|
|
|
|
- name: Upload prebuilds interface
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
retention-days: 7
|
|
name: prebuilds_${{ runner.os }}
|
|
path: "prebuilds/**"
|
|
|
|
win_test:
|
|
runs-on: windows-latest
|
|
strategy:
|
|
matrix:
|
|
node_version: [ 16.x, 17.x, 18.x, 19.x, 20.x ]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
name: Checkout
|
|
|
|
- uses: actions/setup-node@v4
|
|
name: Setup Node.js
|
|
with:
|
|
node-version: ${{ matrix.node_version }}
|
|
|
|
- name: Install dependencies
|
|
run: npm install --no-save --ignore-scripts
|
|
|
|
- name: Test
|
|
run: npm run prebuildify -- -v && ./node_modules/.bin/mocha ./src
|
|
|
|
- name: Upload generate interface
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: addrs_${{ runner.os }}_${{ matrix.node_version }}
|
|
path: "*.addrs.json"
|
|
|
|
- name: Upload prebuilds interface
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
retention-days: 7
|
|
name: prebuilds_${{ runner.os }}
|
|
path: "prebuilds/**"
|
|
|
|
pack_package:
|
|
needs: [ linux_test, macos_test, win_test ]
|
|
runs-on: ubuntu-latest
|
|
name: Pack npm package
|
|
env:
|
|
PACKAGE_VERSION: ${{ github.ref }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
name: Code checkout
|
|
|
|
- uses: actions/setup-node@v4
|
|
name: Setup node.js
|
|
with:
|
|
node-version: 20.x
|
|
registry-url: https://registry.npmjs.org/
|
|
|
|
- name: Download all artefacts
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
path: ./prebuilds
|
|
|
|
- run: npm install --no-save --ignore-scripts
|
|
- run: npm pack
|
|
|
|
- name: Upload npm package
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: Package_Pack
|
|
path: "*.tgz" |