Skip to content

Commit

Permalink
Use an arm VM directly for CI (#461)
Browse files Browse the repository at this point in the history
Summary:
The github provider arm64 runners don't have docker on them, so if we try to use a 'container' stanza to pick a particular linux version, we fail. We don't actually need to use a nested vm since the host is a ubuntu 22 image on arm64 anyway. So just run natively.

needs `sudo` passwordless for apt-get tho

Pull Request resolved: #461

Reviewed By: simonmar

Differential Revision: D59899791

Pulled By: donsbot

fbshipit-source-id: ee869ecac9c16da7e47b1dffb507316c7839c682
  • Loading branch information
donsbot authored and facebook-github-bot committed Jul 18, 2024
1 parent 986455d commit ba67e39
Showing 1 changed file with 23 additions and 38 deletions.
61 changes: 23 additions & 38 deletions .github/workflows/ci-aarch64.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions
name: CI-ARM
on: [push]
on: [push, pull_request]

env:
LANG: en_US.UTF-8
Expand All @@ -13,23 +13,22 @@ jobs:
matrix:
ghc: [8.10.7]
compiler: [clang]

runs-on: 4-core-ubuntu-arm
container:
image: ubuntu:22.04
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Initialize APT
run: |
apt-get update
apt-get install -y curl
sudo apt-get update
sudo apt-get install -y curl
- name: Setup en_US.UTF-8 locale
run: |
apt-get install -y locales
locale-gen en_US.UTF-8
update-locale LANG=en_US.UTF-8
sudo apt-get install -y locales
sudo locale-gen en_US.UTF-8
sudo update-locale LANG=en_US.UTF-8
- name: Setup LOCAL_BIN environment
run: |
Expand All @@ -39,55 +38,44 @@ jobs:
- name: Setup build time flags
run: |
echo "MAKEFLAGS=-j$(nproc)" >> "$GITHUB_ENV"
echo "EXTRA_GHC_OPTS=-j$(nproc) +RTS -A128m -n2m -RTS" >> "$GITHUB_ENV"
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install indexer (flow)
run: npm install -g flow-bin

- name: Install indexer (typescript)
run: npm install -g @sourcegraph/scip-typescript
echo "EXTRA_GHC_OPTS=-j2 +RTS -A128m -n2m -RTS" >> "$GITHUB_ENV"
- name: Setup Haskell
run: |
curl --proto '=https' --tlsv1.2 -sSf "https://downloads.haskell.org/~ghcup/aarch64-linux-ghcup" -o "$LOCAL_BIN"/ghcup
chmod +x "$LOCAL_BIN"/ghcup
ghcup install cabal --set
apt-get install -y build-essential libgmp-dev libnuma-dev
sudo apt-get install -y build-essential libgmp-dev libnuma-dev
ghcup install ghc ${{ matrix.ghc }} --set
echo "$HOME/.ghcup/bin" >> "$GITHUB_PATH"
# This needs to be before the Clang step since they install GCC. We want to remove GCC if Clang is enabled.
- name: Install CMake and Boost
run : apt-get install -y cmake libboost-all-dev
run : sudo apt-get install -y cmake libboost-all-dev

- name: Setup Clang
run: |
export VER=15
apt-get install -y clang-$VER
apt-get remove -y gcc g++
apt-get autoremove -y
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-$VER 10
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-$VER 10
sudo apt-get install -y clang-$VER
sudo apt-get remove -y gcc g++
sudo apt-get autoremove -y
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang-$VER 10
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-$VER 10
# needed for `ghc`, it actually invokes `gcc` explicitly.
update-alternatives --install /usr/bin/gcc gcc /usr/bin/clang-$VER 10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/clang-$VER 10
# needed for `hsc2hs`, `g++` is hardcoded into `hsc2hs-options`.
update-alternatives --install /usr/bin/g++ g++ /usr/bin/clang++-$VER 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/clang++-$VER 10
# and ghc 8.10 on arm needs opt and llc from llvm-12
- name: Install llvm tools for GHC/ARM
run : |
apt-install llvm-12
update-alternatives --install /usr/bin/opt opt /usr/lib/llvm-12/bin/opt 10
update-alternatives --install /usr/bin/llc llc /usr/lib/llvm-12/bin/llc 10
sudo apt-get install -y llvm-12
sudo update-alternatives --install /usr/bin/opt opt /usr/lib/llvm-12/bin/opt 10
sudo update-alternatives --install /usr/bin/llc llc /usr/lib/llvm-12/bin/llc 10
- name: Install folly and rocksdb dependencies
run: |
apt-get install -y git ninja-build \
sudo apt-get install -y git ninja-build \
libaio-dev libbz2-dev libdouble-conversion-dev libdwarf-dev libgoogle-glog-dev libiberty-dev libjemalloc-dev \
liblzma-dev liblz4-dev libsnappy-dev libsodium-dev libssl-dev libunwind-dev libzstd-dev
Expand All @@ -110,7 +98,7 @@ jobs:
run: echo CABAL_CONFIG_FLAGS="-f-hack-tests -f-rust-tests -f-python-tests" >> "$GITHUB_ENV"

- name: Install hsthrift and Glean dependencies
run: apt-get install -y pkg-config rsync libgmock-dev libpcre3-dev libtinfo-dev libxxhash-dev
run: sudo apt-get install -y pkg-config rsync libgmock-dev libpcre3-dev libtinfo-dev libxxhash-dev

- name: Build hsthrift and Glean
run: make
Expand All @@ -119,17 +107,14 @@ jobs:
run: make glass

- name: Install glean-clang dependencies
run: apt-get install -y clang-15 libclang-15-dev libclang-cpp15-dev libre2-dev
run: sudo apt-get install -y clang-15 libclang-15-dev libclang-cpp15-dev libre2-dev

- name: Build glean-clang
run: make glean-clang

- name: Build hiedb-indexer
run: make glean-hiedb

- name: Run tests
run: make test

# check the vscode extension builds
vscode:
runs-on: ubuntu-latest
Expand Down

0 comments on commit ba67e39

Please sign in to comment.