Track missing file #2618
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions | |
name: CI | |
on: [push, pull_request] | |
env: | |
LANG: en_US.UTF-8 | |
jobs: | |
ci: | |
strategy: | |
fail-fast: false | |
matrix: | |
ghc: [8.6.5, 8.8.4, 8.10.7] | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/facebookincubator/hsthrift/ci-base:ghcup | |
options: --cpus 2 --security-opt=seccomp=unconfined | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install additional tools | |
run: | | |
apt-get update | |
apt install -y ninja-build libxxhash-dev m4 rsync wget unzip clang-11 libclang-11-dev llvm-11-dev libgmock-dev | |
apt-get remove -y libfmt-dev | |
- name: Make utf8 default locale | |
run: | | |
apt-get install -y locales | |
locale-gen en_US.UTF-8 | |
update-locale LANG=en_US.UTF-8 | |
- name: Install GHC ${{ matrix.ghc }} | |
run: ghcup install ghc ${{ matrix.ghc }} --set | |
- name: Install cabal-install 3.8 | |
run: ghcup install cabal -u https://downloads.haskell.org/~cabal/cabal-install-3.8.1.0/cabal-install-3.8.1.0-x86_64-linux-deb10.tar.xz 3.8.1.0 --set | |
- name: Add GHC and cabal to PATH | |
run: echo "$HOME/.ghcup/bin" >> "$GITHUB_PATH" | |
- name: Install indexer (flow) | |
run: | | |
export FLOW=0.209.1 | |
wget "https://github.com/facebook/flow/releases/download/v${FLOW}/flow-linux64-v${FLOW}.zip" | |
unzip "flow-linux64-v${FLOW}.zip" | |
mkdir -p "$HOME"/.hsthrift/bin && mv flow/flow "$HOME"/.hsthrift/bin | |
- name: Install indexer (hack) | |
run: | | |
apt-get install -y software-properties-common apt-transport-https | |
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xB4112585D386EB94 | |
# NB. https stopped working at some point, certificate failure | |
add-apt-repository http://dl.hhvm.com/ubuntu | |
apt-get update | |
apt-get install -y hhvm-nightly | |
- name: Install indexer (typescript) | |
run: | | |
curl -fsSL https://deb.nodesource.com/setup_16.x | bash - | |
apt-get install -y nodejs | |
npm install -g @sourcegraph/scip-typescript | |
- name: Install indexer (go) | |
run: | | |
export GOLANG=1.17.8 | |
export SCIPGO=0.1.4 | |
mkdir go-install; cd go-install | |
wget "https://go.dev/dl/go${GOLANG}.linux-amd64.tar.gz" | |
tar -C "$HOME/.hsthrift" -xzf "go${GOLANG}.linux-amd64.tar.gz" | |
wget "https://github.com/sourcegraph/scip-go/releases/download/v${SCIPGO}/scip-go_${SCIPGO}_linux_amd64.tar.gz" | |
tar xzf "scip-go_${SCIPGO}_linux_amd64.tar.gz" | |
mkdir -p "$HOME"/.hsthrift/bin && mv scip-go "$HOME"/.hsthrift/bin | |
echo "$HOME/.hsthrift/go/bin" >> "$GITHUB_PATH" | |
- name: Install indexer (rust) | |
run: | | |
export RUST_ANALYZER=2023-06-19 | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" | |
mkdir -p "$HOME"/.hsthrift/bin | |
curl -L https://github.com/rust-analyzer/rust-analyzer/releases/download/${RUST_ANALYZER}/rust-analyzer-x86_64-unknown-linux-gnu.gz | gunzip -c - > "$HOME"/.hsthrift/bin/rust-analyzer | |
chmod +x "$HOME"/.hsthrift/bin/rust-analyzer | |
- name: Install indexer (java) | |
run: | | |
apt-get install -y default-jdk maven | |
curl -fLo coursier https://git.io/coursier-cli && chmod +x coursier | |
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/ | |
./coursier bootstrap --standalone -o lsif-java com.sourcegraph:lsif-java_2.13:0.8.0-RC1 --main-class com.sourcegraph.lsif_java.LsifJava | |
mkdir -p "$HOME"/.hsthrift/bin && cp lsif-java "$HOME"/.hsthrift/bin | |
- name: Fetch hsthrift and build folly, rocksdb | |
run: ./install_deps.sh | |
- name: Nuke build artifacts | |
run: rm -rf /tmp/fbcode_builder_getdeps-Z__wZGleanZGleanZhsthriftZbuildZfbcode_builder-root/ | |
- name: Add thrift compiler and indexers to path | |
run: echo "$HOME/.hsthrift/bin" >> "$GITHUB_PATH" | |
- name: Populate hackage index | |
run: cabal update | |
- name: Build hsthrift and Glean | |
run: env LD_LIBRARY_PATH="$HOME/.hsthrift/lib" PKG_CONFIG_PATH="$HOME/.hsthrift/lib/pkgconfig" make | |
- name: Build glass | |
run: env LD_LIBRARY_PATH="$HOME/.hsthrift/lib" PKG_CONFIG_PATH="$HOME/.hsthrift/lib/pkgconfig" make glass | |
- name: Build glean-clang | |
run: env LD_LIBRARY_PATH="$HOME/.hsthrift/lib" PKG_CONFIG_PATH="$HOME/.hsthrift/lib/pkgconfig" make glean-clang | |
- if: matrix.ghc != '8.4.4' && matrix.ghc != '8.6.5' | |
name: Build hiedb-indexer | |
run: env LD_LIBRARY_PATH="$HOME/.hsthrift/lib" PKG_CONFIG_PATH="$HOME/.hsthrift/lib/pkgconfig" make glean-hiedb | |
- name: Run tests | |
# External hh_server hasn't caught up with the internal | |
# version yet so the test output differs. Disable the Hack | |
# tests temporarily. | |
run: env LD_LIBRARY_PATH="$HOME/.hsthrift/lib" PKG_CONFIG_PATH="$HOME/.hsthrift/lib/pkgconfig" cabal test glean:tests -f-hack-tests | |
# check the vscode extension builds | |
vscode: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Node | |
uses: actions/setup-node@v2 | |
- name: Build VS Code extension | |
run: npx vsce package | |
working-directory: glean/vscode | |
- name: Archive .vsix extension file | |
uses: actions/upload-artifact@v2 | |
with: | |
name: glean-vsix | |
path: | | |
glean/vscode/*.vsix |