Skip to content
This repository has been archived by the owner on Oct 6, 2022. It is now read-only.

Commit

Permalink
Add linux-aarch64 job to circleci (#13)
Browse files Browse the repository at this point in the history
* Add linux-aarch64 job to circleci

* fixup! Add linux-aarch64 job to circleci
  • Loading branch information
hangyas authored May 9, 2022
1 parent 4f329ee commit f95551e
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 1 deletion.
73 changes: 73 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,78 @@ jobs:
- store_artifacts:
path: /tmp/release
destination: release
linux-aarch64:
docker:
- image: circleci/clojure:openjdk-11-lein-browsers
working_directory: ~/repo
environment:
LEIN_ROOT: 'true'
GRAALVM_HOME: /home/circleci/graalvm-ce-java11-21.3.0
BABASHKA_PLATFORM: linux
POD_ARCH: aarch64
BABASHKA_XMX: -J-Xmx7g
POD_TEST_ENV: native
resource_class: large
steps:
- checkout
- run:
name: Pull Submodules
command: |
git submodule init
git submodule update
- restore_cache:
keys:
- linux-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }}
- run:
name: Install Clojure
command: |2-
wget https://download.clojure.org/install/linux-install-1.10.3.1058.sh
chmod +x linux-install-1.10.3.1058.sh
sudo ./linux-install-1.10.3.1058.sh
- run:
name: Install babashka
command: |-
curl -sLO https://raw.githubusercontent.com/babashka/babashka/master/install
chmod +x install
sudo ./install
- run:
name: Install lsof
command: |
sudo apt-get install lsof
- run:
name: Install native dev tools
command: |
sudo apt-get update
sudo apt-get -y install gcc g++ zlib1g-dev
- run:
name: Download GraalVM
command: |2-
cd ~
if ! [ -d graalvm-ce-java11-21.3.0 ]; then
curl -O -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.3.0/graalvm-ce-java11-linux-aarch64-21.3.0.tar.gz
tar xzf graalvm-ce-java11-linux-aarch64-21.3.0.tar.gz
fi
- run:
name: Build binary
command: bb native-image
no_output_timeout: 30m
- run:
name: Run tests
command: bb test
- run:
name: Release
command: |
.circleci/script/release
- save_cache:
paths:
- ~/.m2
- ~/graalvm-ce-java11-21.3.0
key: linux-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }}
- store_artifacts:
path: /tmp/release
destination: release
mac:
macos:
xcode: 12.0.0
Expand Down Expand Up @@ -174,4 +246,5 @@ workflows:
jobs:
- jvm
- linux
- linux-aarch64
- mac
3 changes: 2 additions & 1 deletion .circleci/script/release
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ mkdir -p /tmp/release
cp "pod-babashka-etaoin" /tmp/release

VERSION=$(cat resources/POD_VERSION)
ARCH=${POD_ARCH:-amd64}

cd /tmp/release

## release binary as zip archive

zip "pod-babashka-etaoin-$VERSION-$BABASHKA_PLATFORM-amd64.zip" "pod-babashka-etaoin"
zip "pod-babashka-etaoin-$VERSION-$BABASHKA_PLATFORM-$ARCH.zip" "pod-babashka-etaoin"

## cleanup

Expand Down
45 changes: 45 additions & 0 deletions script/generate_circleci.clj
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,49 @@ fi"}}
{:store_artifacts {:path "/tmp/release",
:destination "release"}}]))

(def linux-aarch64
(ordered-map :docker [{:image "circleci/clojure:openjdk-11-lein-browsers"}]
:working_directory "~/repo"
:environment (ordered-map :LEIN_ROOT "true"
:GRAALVM_HOME "/home/circleci/graalvm-ce-java11-21.3.0"
:BABASHKA_PLATFORM "linux"
:POD_ARCH "aarch64"
:BABASHKA_XMX "-J-Xmx7g"
:POD_TEST_ENV "native"
:resource_class "large")
:steps ["checkout"
{:run {:name "Pull Submodules",
:command "git submodule init\ngit submodule update\n"}}
{:restore_cache {:keys ["linux-{{ checksum \"project.clj\" }}-{{ checksum \".circleci/config.yml\" }}"]}}
{:run {:name "Install Clojure",
:command "
wget https://download.clojure.org/install/linux-install-1.10.3.1058.sh
chmod +x linux-install-1.10.3.1058.sh
sudo ./linux-install-1.10.3.1058.sh"}}
install-babashka
{:run {:name "Install lsof",
:command "sudo apt-get install lsof\n"}}
{:run {:name "Install native dev tools",
:command "sudo apt-get update\nsudo apt-get -y install gcc g++ zlib1g-dev\n"}}
{:run {:name "Download GraalVM",
:command "
cd ~
if ! [ -d graalvm-ce-java11-21.3.0 ]; then
curl -O -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.3.0/graalvm-ce-java11-linux-aarch64-21.3.0.tar.gz
tar xzf graalvm-ce-java11-linux-aarch64-21.3.0.tar.gz
fi"}}
{:run {:name "Build binary",
:command "bb native-image",
:no_output_timeout "30m"}}
run-tests
{:run {:name "Release",
:command ".circleci/script/release\n"}}
{:save_cache {:paths ["~/.m2"
"~/graalvm-ce-java11-21.3.0"],
:key "linux-{{ checksum \"project.clj\" }}-{{ checksum \".circleci/config.yml\" }}"}}
{:store_artifacts {:path "/tmp/release",
:destination "release"}}]))

(def mac
(ordered-map :macos {:xcode "12.0.0"},
:environment (ordered-map :GRAALVM_HOME "/Users/distiller/graalvm-ce-java11-21.3.0/Contents/Home",
Expand Down Expand Up @@ -121,11 +164,13 @@ fi"}}
:jobs (ordered-map
:jvm jvm
:linux linux
:linux-aarch64 linux-aarch64
:mac mac),
:workflows (ordered-map
:version 2
:ci {:jobs ["jvm"
"linux"
"linux-aarch64"
"mac"]})))

(require '[clj-yaml.core :as yaml])
Expand Down

0 comments on commit f95551e

Please sign in to comment.