This repository has been archived on 2024-10-20. You can view files and clone it, but cannot push or open issues or pull requests.
Wireguard-tools.js/.gitea/workflows/test.yml
Matheus Sampaio Queiroga a399f89350
Migrate tests to node test and Add key gen in node
I'm adding key generation to pure Javascript, port of `keygen-html`.

I'm also migrating the mocha tests to the Node tests runner.

I solved a typescript typing problem

add gitea CI/CD

Gitlab CI/CD and Github Actions update test
2024-01-14 15:18:29 -03:00

101 lines
2.4 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, 18.x, 19.x, 20.x, 21.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: |
echo "Host arch: $(uname -m)"
export DEBIAN_FRONTEND=noninteractive
sudo apt update
packages=(
"binutils-multiarch"
"build-essential"
);
# if [[ $(uname -m) == "x86_64" ]]; then
# packages+=(
# "libc6-arm64-cross"
# "gcc-*aarch64-linux-gnu"
# "gcc-*aarch64-linux-gnu-base"
# "g++-*aarch64-linux-gnu"
# )
# else
# packages+=(
# "libc6-amd64-cross"
# "g++-*x86-64-linux-gnu"
# "gcc-*x86-64-linux-gnu"
# )
# if [[ $(uname -m) != "aarch64" ]]; then
# packages+=(
# "libc6-arm64-cross"
# "gcc-*aarch64-linux-gnu"
# "gcc-*aarch64-linux-gnu-base"
# "g++-*aarch64-linux-gnu"
# )
# fi
# fi
sudo apt install -y ${packages[@]}
npm install --no-save --ignore-scripts
- name: Build addon
run: npm run dev
- name: Upload prebuilds interface
uses: actions/upload-artifact@v3
with:
retention-days: 7
name: prebuilds_${{ runner.os }}_${{ matrix.node_version }}
path: "prebuilds/**"
- name: Test
run: node --require ts-node/register --loader ts-node/esm ./src/index_test.ts
pack_package:
needs: linux_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"