diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 43490ed2..6745bd4f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,55 +19,6 @@ jobs: fail-fast: false matrix: settings: - - host: macos-latest - architecture: x64 - target: 'x86_64-apple-darwin' - build: | - yarn build - strip -x packages/*/*.node - - host: windows-latest - architecture: x64 - build: yarn build - target: 'x86_64-pc-windows-msvc' - - host: windows-latest - architecture: x86 - build: | - npx lerna exec "yarn build --target i686-pc-windows-msvc" --concurrency 1 --stream --no-prefix - yarn test - target: 'i686-pc-windows-msvc' - - host: ubuntu-latest - architecture: x64 - target: 'x86_64-unknown-linux-gnu' - docker: | - docker pull $DOCKER_REGISTRY_URL/napi-rs/napi-rs/nodejs-rust:lts-debian - docker tag $DOCKER_REGISTRY_URL/napi-rs/napi-rs/nodejs-rust:lts-debian builder - build: | - docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/build -w /build builder yarn build - - host: ubuntu-latest - architecture: x64 - target: 'x86_64-unknown-linux-musl' - docker: | - docker pull $DOCKER_REGISTRY_URL/napi-rs/napi-rs/nodejs-rust:lts-alpine - docker tag $DOCKER_REGISTRY_URL/napi-rs/napi-rs/nodejs-rust:lts-alpine builder - build: docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/build -w /build builder yarn build - - host: macos-latest - architecture: x64 - target: 'aarch64-apple-darwin' - build: | - sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*; - export CC=$(xcrun -f clang); - export CXX=$(xcrun -f clang++); - SYSROOT=$(xcrun --sdk macosx --show-sdk-path); - export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT"; - npx lerna exec "yarn build --target aarch64-apple-darwin" --concurrency 1 --stream --no-prefix - strip -x packages/*/*.node - - host: ubuntu-latest - architecture: x64 - target: 'aarch64-unknown-linux-gnu' - setup: | - sudo apt-get update - sudo apt-get install g++-aarch64-linux-gnu gcc-aarch64-linux-gnu -y - build: npx lerna exec "yarn build --target aarch64-unknown-linux-gnu" --concurrency 1 --stream --no-prefix - host: ubuntu-latest architecture: x64 target: 'armv7-unknown-linux-gnueabihf' @@ -75,36 +26,6 @@ jobs: sudo apt-get update sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y build: npx lerna exec "yarn build --target armv7-unknown-linux-gnueabihf" --concurrency 1 --stream --no-prefix - - host: ubuntu-latest - architecture: x64 - target: aarch64-linux-android - build: | - export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang" - export CC="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang" - export CXX="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang++" - export PATH="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin:${PATH}" - npx lerna exec "yarn build --target aarch64-linux-android" --concurrency 1 --stream --no-prefix - - host: ubuntu-latest - architecture: x64 - target: armv7-linux-androideabi - build: | - export CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang" - export CC="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang" - export CXX="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang++" - export PATH="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin:${PATH}" - npx lerna exec "yarn build --target armv7-linux-androideabi" --concurrency 1 --stream --no-prefix - - host: ubuntu-latest - architecture: x64 - target: 'aarch64-unknown-linux-musl' - downloadTarget: 'aarch64-unknown-linux-musl' - docker: | - docker pull ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine - docker tag ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine builder - build: docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/node-rs -w /node-rs builder sh -c "rustup toolchain install $(cat ./rust-toolchain) && rustup target add aarch64-unknown-linux-musl && yarn global add lerna && lerna exec \"yarn build --target aarch64-unknown-linux-musl\" --concurrency 1 --stream --no-prefix" - - host: windows-latest - architecture: x64 - target: 'aarch64-pc-windows-msvc' - build: npx lerna exec "yarn build --target aarch64-pc-windows-msvc" --concurrency 1 --stream --no-prefix name: stable - ${{ matrix.settings.target }} - node@16 runs-on: ${{ matrix.settings.host }} @@ -179,201 +100,8 @@ jobs: name: bindings-${{ matrix.settings.target }} path: packages/*/*.node - build-freebsd: - runs-on: macos-10.15 - name: Build FreeBSD - steps: - - uses: actions/checkout@v2 - - name: Build - id: build - uses: vmactions/freebsd-vm@v0.1.5 - env: - DEBUG: 'napi:*' - RUSTUP_HOME: /usr/local/rustup - CARGO_HOME: /usr/local/cargo - RUSTUP_IO_THREADS: 1 - with: - envs: 'DEBUG RUSTUP_HOME CARGO_HOME RUSTUP_IO_THREADS' - usesh: true - mem: 3000 - prepare: | - pkg install -y curl python2 node14 - curl -qL https://www.npmjs.com/install.sh | sh - npm install -g yarn - curl https://sh.rustup.rs -sSf --output rustup.sh - sh rustup.sh -y --profile minimal --default-toolchain stable - export PATH="/usr/local/cargo/bin:$PATH" - echo "~~~~ rustc --version ~~~~" - rustc --version - echo "~~~~ node -v ~~~~" - node -v - echo "~~~~ yarn --version ~~~~" - yarn --version - run: | - export PATH="/usr/local/cargo/bin:$PATH" - pwd - ls -lah - whoami - env - freebsd-version - yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000 - yarn build:ts - yarn build - yarn test - rm -rf node_modules - rm -rf target - - - name: Upload artifact - uses: actions/upload-artifact@v2 - with: - name: bindings-freebsd-amd64 - path: packages/*/*.node - - test-macOS-windows-binding: - name: Test bindings on ${{ matrix.settings.target }} - node@${{ matrix.node }} - needs: - - build - strategy: - fail-fast: false - matrix: - settings: - - host: macos-latest - target: 'x86_64-apple-darwin' - - host: windows-latest - target: 'x86_64-pc-windows-msvc' - node: ['12', '14', '16'] - runs-on: ${{ matrix.settings.host }} - - steps: - - uses: actions/checkout@v2 - with: - submodules: true - - - name: Setup node - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node }} - check-latest: true - - - name: Install dependencies - run: yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000 - - - name: Download artifacts - uses: actions/download-artifact@v2 - with: - name: bindings-${{ matrix.settings.target }} - path: artifacts - - - name: Move artifacts - run: yarn artifacts - shell: bash - - - name: Build TypeScript - run: yarn build:ts - - - name: Test bindings - run: yarn test - - test-linux-x64-gnu-binding: - name: Test bindings on Linux-x64-gnu - node@${{ matrix.node }} - needs: - - build - strategy: - fail-fast: false - matrix: - node: ['12', '14', '16'] - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Setup node - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node }} - check-latest: true - cache: yarn - - - name: Install dependencies - run: yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000 - - - name: Download artifacts - uses: actions/download-artifact@v2 - with: - name: bindings-x86_64-unknown-linux-gnu - path: artifacts - - - name: Move artifacts - run: yarn artifacts - shell: bash - - - name: List packages - run: ls -R packages - shell: bash - - - name: Build TypeScript - run: yarn build:ts - - - name: Test bindings - uses: addnab/docker-run-action@v3 - with: - image: node:${{ matrix.node }}-slim - options: -v ${{ github.workspace }}:/build -w /build - run: | - npx lerna link - yarn test - - test-linux-x64-musl-binding: - name: Test bindings on x86_64-unknown-linux-musl - node@${{ matrix.node }} - needs: - - build - strategy: - fail-fast: false - matrix: - node: ['12', '14', '16'] - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Setup node - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node }} - check-latest: true - cache: yarn - - - name: Install dependencies - run: yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000 - - - name: Build TypeScript - run: yarn build:ts - - - name: Download artifacts - uses: actions/download-artifact@v2 - with: - name: bindings-x86_64-unknown-linux-musl - path: artifacts - - - name: Move artifacts - run: yarn artifacts - shell: bash - - - name: List packages - run: ls -R packages - shell: bash - - - name: Test bindings - uses: addnab/docker-run-action@v3 - with: - image: node:${{ matrix.node }}-alpine - options: -v ${{ github.workspace }}:/build -w /build - run: | - npx lerna link - yarn test - - test-linux-aarch64-gnu-binding: - name: Test bindings on aarch64-unknown-linux-gnu - node@${{ matrix.node }} + test-linux-arm-gnueabihf-binding: + name: Test bindings on armv7-unknown-linux-gnueabihf - node@${{ matrix.node }} needs: - build strategy: @@ -387,171 +115,75 @@ jobs: - uses: actions/checkout@v2 - - name: Download artifacts - uses: actions/download-artifact@v2 - with: - name: bindings-aarch64-unknown-linux-gnu - path: artifacts - - name: Install dependencies run: yarn install --ignore-scripts --ignore-platform --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000 - - name: Move artifacts - run: yarn artifacts - shell: bash - - - name: List packages - run: ls -R packages - shell: bash - - - name: Setup and run tests - uses: addnab/docker-run-action@v3 - with: - image: ghcr.io/napi-rs/napi-rs/nodejs:aarch64-${{ matrix.node }} - options: -v ${{ github.workspace }}:/build -w /build - run: | - set -e - yarn build:ts - yarn test - ls -la - - test-linux-aarch64-musl-binding: - name: Test bindings on aarch64-unknown-linux-musl - node@${{ matrix.node }} - needs: - - build - - runs-on: ubuntu-latest - - steps: - - run: docker run --rm --privileged multiarch/qemu-user-static:register --reset - - - uses: actions/checkout@v2 - - - name: Install dependencies - run: yarn install --ignore-scripts --frozen-lockfile --ignore-platform --registry https://registry.npmjs.org --network-timeout 300000 - - name: Download artifacts uses: actions/download-artifact@v2 with: - name: bindings-aarch64-unknown-linux-musl - path: packages + name: bindings-armv7-unknown-linux-gnueabihf + path: artifacts - name: Move artifacts run: yarn artifacts shell: bash - name: List packages - run: ls -R packages + run: ls -R ./packages shell: bash - name: Setup and run tests uses: addnab/docker-run-action@v3 with: - image: multiarch/alpine:aarch64-latest-stable + image: ghcr.io/napi-rs/napi-rs/nodejs:armhf-${{ matrix.node }} options: -v ${{ github.workspace }}:/build -w /build run: | set -e - apk add nodejs npm yarn yarn build:ts yarn test + ls -la - test-linux-arm-gnueabihf-binding: + test-linux-Raspberry-Pi-binding: name: Test bindings on armv7-unknown-linux-gnueabihf - node@${{ matrix.node }} needs: - build strategy: fail-fast: false matrix: - node: ['12', '14', '16'] + node: + - '12' + - '14' + - '16' runs-on: ubuntu-latest - steps: - run: docker run --rm --privileged multiarch/qemu-user-static:register --reset - - uses: actions/checkout@v2 - - - name: Install dependencies - run: yarn install --ignore-scripts --ignore-platform --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000 - - name: Download artifacts uses: actions/download-artifact@v2 with: name: bindings-armv7-unknown-linux-gnueabihf - path: artifacts - - - name: Move artifacts - run: yarn artifacts - shell: bash - + path: . - name: List packages - run: ls -R ./packages + run: ls -R . shell: bash - + - name: Cache NPM dependencies + uses: actions/cache@v2 + with: + path: node_modules + key: npm-cache-test-linux-arm-gnueabihf-${{ matrix.node }}-${{ hashFiles('yarn.lock') }} + - name: Install dependencies + run: yarn install --ignore-scripts --ignore-platform --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000 - name: Setup and run tests uses: addnab/docker-run-action@v3 with: - image: ghcr.io/napi-rs/napi-rs/nodejs:armhf-${{ matrix.node }} - options: -v ${{ github.workspace }}:/build -w /build + image: multiarch/ubuntu-core:arm64-wily + options: '-v ${{ github.workspace }}:/build -w /build' run: | set -e + curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash - + sudo apt-get install -y nodejs + sudo apt-get install -y build-essential + npm install yarn -g yarn build:ts yarn test ls -la - - publish: - name: Publish - runs-on: ubuntu-latest - needs: - - build-freebsd - - test-linux-x64-gnu-binding - - test-linux-x64-musl-binding - - test-linux-aarch64-gnu-binding - - test-linux-arm-gnueabihf-binding - - test-macOS-windows-binding - steps: - - uses: actions/checkout@v2 - - - name: Setup node - uses: actions/setup-node@v2-beta - with: - node-version: 16 - check-latest: true - cache: yarn - - - name: Cache NPM dependencies - uses: actions/cache@v2 - with: - path: node_modules - key: npm-cache-ubuntu-latest-publish-${{ hashFiles('yarn.lock') }} - - - name: 'Install dependencies' - run: yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000 - - - name: Download all artifacts - uses: actions/download-artifact@v2 - with: - path: artifacts - - - name: List artifacts - run: ls -R artifacts - shell: bash - - - name: Move artifacts - run: yarn artifacts - - - name: Build TypeScript - run: yarn build:ts - - - name: List packages - run: ls -R packages - shell: bash - - - name: Lerna publish - if: "startsWith(github.event.head_commit.message, 'chore(release): publish')" - run: | - find ./packages/ -type d -maxdepth 1 -exec cp LICENSE {} \; - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN">> ~/.npmrc - npx lerna publish from-package --no-verify-access --yes - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

AltStyle によって変換されたページ (->オリジナル) /