Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(arch): build aarch64 #1022

Merged
merged 8 commits into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
101 changes: 101 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,33 @@ orbs:
win: circleci/[email protected]

jobs:
build-aarch64:
machine:
image: ubuntu-2004:2022.04.1
resource_class: arm.medium

working_directory: ~/repo

steps:
- checkout
- attach_workspace:
at: .

- run: npm ci

- run: |
make test
mkdir -p coverage-aarch64
cp -r coverage/* coverage-aarch64/

- run: make build_aarch64

- persist_to_workspace:
root: .
paths:
- out/codecov-aarch64
- coverage-aarch64

build-linux-and-osx:
docker:
- image: cimg/node:17.9.1@sha256:672e6db46d85bb5f2d5f301a612635ff1d2563303710b4e699d521f620b1bb6e
Expand Down Expand Up @@ -246,6 +273,66 @@ jobs:
paths:
- output_linux_without_git.txt

test-aarch64:
machine:
image: ubuntu-2004:2022.04.1
resource_class: arm.medium
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Confirm that aarch64 uploader binary is static
command: |
file out/codecov-aarch64
- run:
name: Confirm that aarch64 uploader binary is static
command: |
(file out/codecov-aarch64 | grep 'static') || exit ${?}
- run:
name: Run aarch64 binary -f (dry run)
command: |
out/codecov-aarch64 -f /home/circleci/project/coverage/cobertura-coverage.xml -F aarch64 -d -Z -v -e CIRCLE_BRANCH >> output_aarch64.txt
- run:
name: Run aarch64 binary auto-detect (dry run)
command: |
out/codecov-aarch64 -F aarch64 -d -Z -e CIRCLE_BRANCH >> output_aarch64.txt
- run:
name: Run aarch64 binary (upload)
command: |
out/codecov-aarch64 -F aarch64 -Z -e CIRCLE_BRANCH
out/codecov-aarch64 -F "-aarch64" -Z -e CIRCLE_BRANCH

- persist_to_workspace:
root: .
paths:
- output_aarch64.txt

test-aarch64-without-git:
machine:
image: ubuntu-2004:2022.04.1
resource_class: arm.medium
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Remove .git directory
command: rm -rf .git
- run:
name: Run Linux binary (dry run)
command: |
out/codecov-aarch64 -F aarch64-without-git -d -Z -e CIRCLE_BRANCH > output_aarch64_without_git.txt
- run:
name: Run Linux binary (upload)
command: |
out/codecov-aarch64 -F aarch64-without-git -Z -e CIRCLE_BRANCH

- persist_to_workspace:
root: .
paths:
- output_aarch64_without_git.txt

test-macos:
macos:
xcode: '12.5.1'
Expand Down Expand Up @@ -400,6 +487,10 @@ jobs:
path: output_alpine_without_git.txt
- store_artifacts:
path: output_linux_without_git.txt
- store_artifacts:
path: output_aarch64.txt
- store_artifacts:
path: output_aarch64_without_git.txt
- store_artifacts:
path: output_osx.txt
- store_artifacts:
Expand Down Expand Up @@ -485,6 +576,9 @@ workflows:
# requires:
# - build-alpine
- build-linux-and-osx
- build-aarch64:
requires:
- build-linux-and-osx
- build-alpine:
requires:
- build-linux-and-osx
Expand All @@ -500,6 +594,12 @@ workflows:
- build-windows:
requires:
- build-linux-and-osx
- test-aarch64:
requires:
- build-aarch64
- test-aarch64-without-git:
requires:
- test-aarch64
- test-linux:
requires:
- build-linux-and-osx
Expand All @@ -523,6 +623,7 @@ workflows:
- test-alpine-proxy
- test-alpine-without-git
- test-linux-without-git
- test-aarch64-without-git
- test-macos-without-git
- test-windows-without-git
- deploy:
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,23 @@ clean:
install:
npm install

test:
test:
rm -rf coverage
rm -rf .nyc_output
npm test


build:

build:
rm -rf out
rm -rf dist
npm run build
npm run build-linux
npm run build-macos

build_aarch64:
npm run build
npm run build-aarch64

build_alpine:
npm run build
npm run build-alpine
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"build:clean": "rm -rf dist",
"build": "tsc --build",
"build-linux": "pkg . --targets linuxstatic --output out/codecov-linux",
"build-aarch64": "pkg . --targets linuxstatic-arm64 --output out/codecov-aarch64",
"build-macos": "pkg . --targets macos --output out/codecov-macos",
"build-alpine": "pkg . --targets node14-alpine-x64 --output out/codecov-alpine",
"build-windows": "pkg . --targets win --output out/codecov.exe",
Expand Down