Skip to content

Commit 44be05f

Browse files
robertoaloifacebook-github-bot
authored andcommitted
Natively assemble eqwalizer instead of using emulation on ARM
Summary: The emulation step takes up to 1h 30m, which represents 86% of the overall CI process. Emulation is not necessary any longer, since [GitHub released arm hosts publicly](https://github.blog/changelog/2025-01-16-linux-arm64-hosted-runners-now-available-for-free-in-public-repositories-public-preview/?fbclid=IwZXh0bgNhZW0CMTEAAR2BwUNr26OpvrR7tpbEhWhaOFoozPymryx3Fo1WOaCPnF6rtMXAJN0gYAc_aem_28GH1eyotDOguj02sAVKLQ). This reduces **CI time from 1h:40m to 20m (80% improvement)**, which should also significantly [bring down the CI costs](https://www.internalfb.com/intern/opensource/github/repo/675902051252178/budget/). Reviewed By: alanz Differential Revision: D69588366 fbshipit-source-id: 2d73403c882bb2c07c318e09158d1f0d8e610c66
1 parent 5cd4fee commit 44be05f

File tree

1 file changed

+6
-33
lines changed

1 file changed

+6
-33
lines changed

.github/workflows/ci.yml

+6-33
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
ci:
1212
strategy:
1313
matrix:
14-
platform-arch: [ubuntu-20.04-x64, ubuntu-20.04-arm, macos-13-x64, macos-latest-arm]
14+
platform-arch: [ubuntu-20.04-x64, ubuntu-22.04-arm, macos-13-x64, macos-latest-arm]
1515
otp-version: [25.3, 26.2, 27.1]
1616
include:
1717
- otp-version: 25.3
@@ -28,8 +28,8 @@ jobs:
2828
os: linux
2929
target: x86_64-unknown-linux-gnu
3030
vscode-target: linux-x64
31-
- platform-arch: ubuntu-20.04-arm
32-
platform: ubuntu-20.04
31+
- platform-arch: ubuntu-22.04-arm
32+
platform: ubuntu-22.04-arm
3333
os: linux
3434
target: aarch64-unknown-linux-gnu
3535
vscode-target: linux-arm64
@@ -54,22 +54,21 @@ jobs:
5454
path: eqwalizer
5555
ref: main
5656
- name: Set up GraalVM
57-
if: matrix.platform-arch != 'ubuntu-20.04-arm'
5857
uses: graalvm/setup-graalvm@v1
5958
with:
6059
java-version: '17'
6160
distribution: 'graalvm'
6261
github-token: ${{ secrets.GITHUB_TOKEN }}
6362
- name: Set up SBT
64-
uses: olafurpg/setup-scala@v11
63+
uses: olafurpg/setup-scala@v14
6564
with:
6665
java-version: '17'
6766
- name: Set up rust toolchain
6867
uses: dtolnay/rust-toolchain@stable
6968
with:
7069
target: ${{ matrix.target }}
7170
- name: Set up cross-compiler
72-
if: matrix.platform-arch == 'ubuntu-20.04-arm'
71+
if: matrix.platform-arch == 'ubuntu-22.04-arm'
7372
run: |
7473
sudo apt-get update
7574
sudo apt-get install -y crossbuild-essential-arm64
@@ -100,37 +99,11 @@ jobs:
10099
working-directory: eqwalizer/eqwalizer
101100
run: "sbt assembly"
102101
- name: Assemble eqwalizer binary
103-
if: matrix.platform-arch != 'ubuntu-20.04-arm'
104102
working-directory: eqwalizer/eqwalizer
105103
run: 'native-image -H:IncludeResources=application.conf --no-server --no-fallback -jar target/scala-2.13/eqwalizer.jar eqwalizer'
106-
- name: Assemble eqwalizer binary (qemu)
107-
if: matrix.platform-arch == 'ubuntu-20.04-arm'
108-
uses: uraimo/run-on-arch-action@v2
109-
with:
110-
arch: aarch64
111-
distro: ubuntu20.04
112-
dockerRunArgs: |
113-
--volume "${PWD}/eqwalizer/eqwalizer:/eqwalizer"
114-
install: |
115-
apt-get -q update
116-
apt-get -q install -y curl gcc zlib1g-dev
117-
GRAALVM_URL=https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_linux-aarch64_bin.tar.gz
118-
GRAALVM_SHA256=$(curl -s "${GRAALVM_URL}.sha256")
119-
curl --output graalvm.tar.gz "${GRAALVM_URL}"
120-
echo "$GRAALVM_SHA256 graalvm.tar.gz" | sha256sum -c
121-
mkdir /opt/graalvm
122-
tar -xzf graalvm.tar.gz -C /opt/graalvm --strip-components=1
123-
run: |
124-
/opt/graalvm/bin/native-image \
125-
-H:IncludeResources=application.conf \
126-
-H:+ReportExceptionStackTraces \
127-
--no-server \
128-
--no-fallback \
129-
-jar /eqwalizer/target/scala-2.13/eqwalizer.jar \
130-
/eqwalizer/eqwalizer
131104
- name: Test elp
132105
# Do not run the tests in case of cross-compilation
133-
if: (matrix.platform-arch != 'ubuntu-20.04-arm') && (matrix.platform-arch != 'macos-latest-arm')
106+
if: matrix.platform-arch != 'macos-latest-arm'
134107
run: 'cargo test --no-default-features --workspace --target ${{ matrix.target }}'
135108
- name: Build elp
136109
run: 'cargo build --release --target ${{ matrix.target }} --config target.aarch64-unknown-linux-gnu.linker=\"aarch64-linux-gnu-gcc\"'

0 commit comments

Comments
 (0)