Skip to content

Commit

Permalink
Added: corepack enable command to CI.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
alMukaafih committed Jul 17, 2024
1 parent 24e4960 commit 38c36d9
Showing 1 changed file with 42 additions and 15 deletions.
57 changes: 42 additions & 15 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,27 @@ jobs:
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
build: yarn build --target x86_64-unknown-linux-gnu
build: |
corepack enable
cd core
yarn build --target x86_64-unknown-linux-gnu
- host: ubuntu-latest
target: x86_64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: yarn build --target x86_64-unknown-linux-musl
build: |
corepack enable
cd core
yarn build --target x86_64-unknown-linux-musl
- host: macos-latest
target: aarch64-apple-darwin
build: yarn build --target aarch64-apple-darwin
- host: ubuntu-latest
target: aarch64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
build: yarn build --target aarch64-unknown-linux-gnu
build: |
corepack enable
cd core
yarn build --target aarch64-unknown-linux-gnu
- host: ubuntu-latest
target: armv7-unknown-linux-gnueabihf
setup: |
Expand All @@ -73,6 +82,8 @@ jobs:
build: |-
set -e &&
rustup target add aarch64-unknown-linux-musl &&
corepack enable &&
cd core &&
yarn build --target aarch64-unknown-linux-musl
- host: windows-latest
target: aarch64-pc-windows-msvc
Expand All @@ -87,12 +98,15 @@ jobs:
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v4
- name: Enable Corepack
run: |
npm install --force -g yarn
corepack enable
- name: Setup node
uses: actions/setup-node@v4
if: ${{ !matrix.settings.docker }}
with:
node-version: 20
cache: yarn
- name: Install
uses: dtolnay/rust-toolchain@stable
if: ${{ !matrix.settings.docker }}
Expand Down Expand Up @@ -122,7 +136,9 @@ jobs:
run: yarn config set supportedArchitectures.cpu "ia32"
shell: bash
- name: Install dependencies
run: yarn install
run: |
cd core
yarn install
- name: Setup node x86
uses: actions/setup-node@v4
if: matrix.settings.target == 'i686-pc-windows-msvc'
Expand All @@ -145,54 +161,57 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: bindings-${{ matrix.settings.target }}
path: ${{ env.APP_NAME }}.*.node
path: "**/${{ env.APP_NAME }}.*.node"
if-no-files-found: error
build-freebsd:
runs-on: macos-13
runs-on: ubuntu-latest
name: Build FreeBSD
steps:
- uses: actions/checkout@v4
- name: Build
id: build
uses: cross-platform-actions/action@v0.24.0
uses: cross-platform-actions/action@v0.25.0
env:
DEBUG: napi:*
RUSTUP_HOME: /usr/local/rustup
CARGO_HOME: /usr/local/cargo
RUSTUP_IO_THREADS: 1
with:
operating_system: freebsd
version: '13.2'
version: '14.0'
memory: 8G
cpu_count: 3
environment_variables: DEBUG RUSTUP_IO_THREADS
environment_variables: 'DEBUG RUSTUP_IO_THREADS'
shell: bash
run: |
sudo pkg install -y -f curl node libnghttp2 npm
sudo pkg install -y -f curl node libnghttp2 npm yarn
sudo npm install -g yarn --ignore-scripts
curl https://sh.rustup.rs -sSf --output rustup.sh
sh rustup.sh -y --profile minimal --default-toolchain stable
sh rustup.sh -y --profile minimal --default-toolchain beta
source "$HOME/.cargo/env"
echo "~~~~ rustc --version ~~~~"
rustc --version
echo "~~~~ node -v ~~~~"
node -v
echo "~~~~ yarn --version ~~~~"
yarn --version
corepack enable
cd core
pwd
ls -lah
whoami
env
freebsd-version
yarn install
yarn build
yarn test
rm -rf node_modules
rm -rf target
rm -rf .yarn/cache
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: bindings-freebsd
path: ${{ env.APP_NAME }}.*.node
path: "**/${{ env.APP_NAME }}.*.node"
if-no-files-found: error
test-macOS-windows-binding:
name: Test bindings on ${{ matrix.settings.target }} - node@${{ matrix.node }}
Expand All @@ -212,6 +231,10 @@ jobs:
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v4
- name: Enable Corepack
run: |
npm install -g corepack
corepack enable
- name: Setup node
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -243,6 +266,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: corepack enable
- name: Setup node
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -273,6 +297,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: corepack enable
- name: Setup node
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -411,6 +436,7 @@ jobs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- run: corepack enable
- name: Setup node
uses: actions/setup-node@v4
with:
Expand All @@ -434,7 +460,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: bindings-universal-apple-darwin
path: ${{ env.APP_NAME }}.*.node
path: "**/${{ env.APP_NAME }}.*.node"
if-no-files-found: error
publish:
name: Publish
Expand All @@ -450,6 +476,7 @@ jobs:
- universal-macOS
steps:
- uses: actions/checkout@v4
- run: corepack enable
- name: Setup node
uses: actions/setup-node@v4
with:
Expand Down

0 comments on commit 38c36d9

Please sign in to comment.