Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ on:

jobs:
check:
runs-on: "ubuntu-latest"
strategy:
matrix:
os: ["ubuntu-latest", "codspeedhq-arm64-ubuntu-22.04"]
runs-on: ${{ matrix.os }}
steps:
- uses: "actions/checkout@v4"
with:
Expand All @@ -35,7 +38,7 @@ jobs:
# list the directories in ./examples and output them to a github action workflow variables as a JSON array
- run: |
examples=$(find ./examples -maxdepth 1 -mindepth 1 -type d -printf '%f\n' | jq -R -s -c 'split("\n") | map(select(length > 0))')
echo "::set-output name=examples::$examples"
echo "examples=$examples" >> $GITHUB_OUTPUT
id: list-examples

node-versions:
Expand Down
36 changes: 35 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,31 @@ permissions:
contents: write

jobs:
build-native-arm:
runs-on: codspeedhq-arm64-ubuntu-22.04

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
cache: pnpm
node-version-file: .nvmrc
- run: pnpm install --frozen-lockfile --prefer-offline
- name: Build native code on ARM
run: pnpm moon core:build-native-addon
- name: Upload ARM prebuilds
uses: actions/upload-artifact@v4
with:
name: arm-prebuilds
path: packages/core/prebuilds

Comment thread
art049 marked this conversation as resolved.
build:
runs-on: ubuntu-latest
needs: build-native-arm

steps:
- uses: actions/checkout@v4
Expand All @@ -28,8 +51,19 @@ jobs:
- name: Build the libraries
run: pnpm moon run :build

- name: Download ARM prebuilds
uses: actions/download-artifact@v4
with:
name: arm-prebuilds
path: packages/core/prebuilds

- name: Publish the libraries
run: pnpm publish -r --access=public --no-git-checks
run: |
if [[ "${{ github.ref }}" == *"-alpha"* ]]; then
pnpm publish -r --access=public --no-git-checks --tag=alpha
else
pnpm publish -r --access=public --no-git-checks
fi
env:
NPM_CONFIG_PROVENANCE: true
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/native_core/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import path from "path";
import { logDebug } from "../utils";
import { InstrumentHooks } from "./instruments/hooks";
import { LinuxPerf } from "./linux_perf/linux_perf";
interface NativeCore {
Expand All @@ -21,6 +22,8 @@ try {
isBound: true,
};
} catch (e) {
logDebug("Failed to bind native core, instruments will not work.");
Comment thread
GuillaumeLagrange marked this conversation as resolved.
logDebug(e);
native_core = {
LinuxPerf: class LinuxPerf {
start() {
Expand Down