Skip to content

Commit

Permalink
fix: fixed prebuild target (#421)
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed Nov 12, 2022
1 parent d595f0d commit 1d8887e
Show file tree
Hide file tree
Showing 15 changed files with 1,192 additions and 804 deletions.
233 changes: 233 additions & 0 deletions .github/workflows/ci-build-and-test.yml
@@ -0,0 +1,233 @@
name: Continuous Integration - Build & Test

on:
push:
branches:
- main
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
build_test_x86_64:
name: Build and Test x86_64 Node v${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-10.15, macos-11, macos-12, ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, windows-2019]
node: [12, 13, 14, 15, 16, 17]
steps:
- name: Checkout Project
uses: actions/checkout@v3

- name: Add problem matcher
run: echo "::add-matcher::.github/problemMatchers/tsc.json"

- name: Use Node.js v${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: yarn
registry-url: https://registry.yarnpkg.org/

- name: Install Dependencies
run: yarn --immutable --mode=skip-build

- name: Build Code
run: yarn build

- name: Test Code
run: yarn vitest run

build_test_x86_64_node_ge_18:
name: Build and Test x86_64 node >= 18
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-10.15, macos-11, macos-12, ubuntu-20.04, ubuntu-22.04, windows-2019]
node: [18]
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Add problem matcher
run: echo "::add-matcher::.github/problemMatchers/tsc.json"

- name: Use Node.js v${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: yarn
registry-url: https://registry.yarnpkg.org/

- name: Install dependencies
run: yarn --immutable --mode=skip-build

- name: Build From Source
run: yarn gyp:build-from-source

- name: Package build
run: yarn build

- name: Test Code
run: yarn vitest run

build_test_musl_x86_64:
name: Build and Test x86_64(musl)
runs-on: ubuntu-latest
container:
image: node:${{ matrix.node }}-alpine
strategy:
fail-fast: false
matrix:
node: [12, 13, 14, 15, 16, 17, 18]
steps:
- name: Setup env with Node v${{ matrix.node }}
run: |
apk add --update
apk add --no-cache ca-certificates git curl build-base python3 g++ make
- name: Checkout repository
uses: actions/checkout@v3

- name: Add problem matcher
run: echo "::add-matcher::.github/problemMatchers/tsc.json"

- name: Install dependencies
run: yarn --immutable --mode=skip-build

- name: Build From Source
run: yarn gyp:build-from-source

- name: Package build
run: yarn build

- name: Test Code
run: yarn vitest run

build_test_aarch64:
name: Build and Test aarch64
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04]
node: [12, 13, 14, 15, 16, 17]
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Add problem matcher
run: echo "::add-matcher::.github/problemMatchers/tsc.json"

- name: Use Node.js v${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: yarn
registry-url: https://registry.yarnpkg.org/

- name: Install dependencies
run: yarn --immutable --mode=skip-build

- name: Build From Source
run: yarn gyp:build-from-source

- name: Package build
run: |
sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ yarn node-pre-gyp --target_arch=arm64 configure build package
- name: Make TypeScript Build
run: yarn ts:build && yarn ts:esm

- name: Test Code
run: yarn vitest run

build_test_aarch64_node_ge_18:
name: Build and Test aarch64 node >= 18
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
node: [18]
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Add problem matcher
run: echo "::add-matcher::.github/problemMatchers/tsc.json"

- name: Use Node.js v${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: yarn
registry-url: https://registry.yarnpkg.org/

- name: Install dependencies
run: yarn --immutable --mode=skip-build

- name: Build From Source
run: yarn gyp:build-from-source

- name: Package build
run: |
sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ yarn node-pre-gyp --target_arch=arm64 configure build package
- name: Make TypeScript Build
run: yarn ts:build && yarn ts:esm

- name: Test Code
run: yarn vitest run

build_test_musl_aarch64:
name: Build and Test aarch64(musl)
runs-on: ubuntu-latest
container:
image: node:${{ matrix.node }}-alpine
strategy:
fail-fast: false
matrix:
node: [12, 13, 14, 15, 16, 17, 18]
steps:
- name: Setup env with Node v${{ matrix.node }}
run: |
apk add --update
apk add --no-cache ca-certificates git curl build-base python3 g++ make
- name: Checkout repository
uses: actions/checkout@v3

- name: Add problem matcher
run: echo "::add-matcher::.github/problemMatchers/tsc.json"

- name: Setup musl cross compiler
run: |
curl -OL https://musl.cc/aarch64-linux-musl-cross.tgz
tar -xzvf aarch64-linux-musl-cross.tgz
$(pwd)/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc --version
- name: Install dependencies
run: yarn --immutable --mode=skip-build

- name: Build From Source
run: yarn gyp:build-from-source

- name: Package build
run: |
CC=$(pwd)/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc \
CXX=$(pwd)/aarch64-linux-musl-cross/bin/aarch64-linux-musl-g++ \
yarn node-pre-gyp --target_arch=arm64 configure build package
- name: Make TypeScript Build
run: yarn ts:build && yarn ts:esm

- name: Test Code
run: yarn vitest run
48 changes: 48 additions & 0 deletions .github/workflows/ci-lint-and-docs.yml
@@ -0,0 +1,48 @@
name: Continuous Integration - Lint & Docs

on:
push:
branches:
- main
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
Linting:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v3
- name: Add problem matcher
run: echo "::add-matcher::.github/problemMatchers/eslint.json"
- name: Use Node.js v18
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
registry-url: https://registry.yarnpkg.org/
- name: Install Dependencies
run: yarn --immutable
- name: Run ESLint
run: yarn lint --fix=false

docs:
name: Generate Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v3
- name: Use Node.js v18
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
registry-url: https://registry.npmjs.org/
- name: Install Dependencies
run: yarn --immutable
- name: Generate Documentation
run: yarn docs
115 changes: 0 additions & 115 deletions .github/workflows/continuous-integration.yml

This file was deleted.

0 comments on commit 1d8887e

Please sign in to comment.