ci: add riscv64gc-unknown-linux-gnu

This commit is contained in:
kxxt 2023-05-26 08:55:00 +08:00
parent 72fcd03d98
commit 173553c037
3 changed files with 70 additions and 0 deletions

53
.github/workflows/linux-riscv64.yaml vendored Normal file
View file

@ -0,0 +1,53 @@
name: Linux-riscv64
env:
DEBUG: 'napi:*'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- main
pull_request:
jobs:
build:
name: stable - riscv64-unknown-linux-gnu - node@18
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- name: Install
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: riscv64gc-unknown-linux-gnu
- name: Cache cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
key: stable-linux-riscv64-gnu-node@18-cargo-cache
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y gcc-riscv64-linux-gnu
yarn config set --json supportedArchitectures.cpu '["current", "riscv64"]'
yarn config set supportedArchitectures.libc "glibc"
yarn install --immutable --mode=skip-build
- name: Cross build native tests
run: yarn build:test -- --target riscv64gc-unknown-linux-gnu

View file

@ -94,6 +94,14 @@ jobs:
- host: windows-latest
target: 'aarch64-pc-windows-msvc'
build: yarn build --platform --target aarch64-pc-windows-msvc
- host: ubuntu-latest
target: 'riscv64gc-unknown-linux-gnu'
setup: |
sudo apt-get update
sudo apt-get install gcc-riscv64-linux-gnu -y
build: |
yarn build --platform --target riscv64gc-unknown-linux-gnu
riscv64-linux-gnu-strip *.node
name: stable - \${{ matrix.settings.target }} - node@18
runs-on: \${{ matrix.settings.host }}

View file

@ -99,4 +99,13 @@ export const CIConfig: Partial<
],
test: false,
},
'riscv64gc-unknown-linux-gnu': {
host: 'ubuntu-latest',
build_setup: [
'sudo apt-get update',
'sudo apt-get install g++-riscv64-linux-gnu gcc-riscv64-linux-gnu -y',
],
// No official nodejs docker image for riscv64
test: false,
},
}