Skip to content

Commit

Permalink
Migrate tests to github actions
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Davidge <[email protected]>
  • Loading branch information
Henry Davidge committed Feb 29, 2024
1 parent d366a67 commit b5d91b8
Showing 1 changed file with 92 additions and 0 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Tests

on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: "0 0 * * *"

jobs:
check-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Conda
run: |
if [ ! -d "$HOME/conda" ]; then
wget https://repo.anaconda.com/miniconda/Miniconda3-py38_23.11.0-2-Linux-x86_64.sh
/bin/bash Miniconda3-py38_23.11.0-2-Linux-x86_64.sh -b -p $HOME/conda
else
echo "Conda already installed"
fi
- name: Set up Conda environment
run: |
export PATH=$HOME/conda/bin:$PATH
conda install -n base conda-libmamba-solver
conda config --set solver libmamba
conda env create -f python/environment.yml
conda env create -f docs/source/environment.yml
- name: Install Certs
run: sudo apt-get install -y ca-certificates

- name: Check docs links
run: |
export PATH=$HOME/conda/envs/glow-docs/bin:$PATH
cd docs
make linkcheck
- name: Configure Databricks CLI
run: |
printf "[docs-ci]\nhost = https://adb-984752964297111.11.azuredatabricks.net\ntoken = ${{ secrets.DATABRICKS_API_TOKEN }}\njobs-api-version = 2.1\n" > ~/.databrickscfg
- name: Generate notebook source files
run: |
export PATH=$HOME/conda/envs/glow/bin:$PATH
for f in $(find docs/source/_static/notebooks -type f -name '*.html'); do
python docs/dev/gen-nb-src.py --html "${f}" --cli-profile docs-ci
done
spark-tests:
runs-on: ubuntu-latest
strategy:
matrix:
spark_version: [3.4.1, 3.5.0]
scala_version: [2.12.18]
env:
SPARK_VERSION: ${{ matrix.spark_version }}
SCALA_VERSION: ${{ matrix.scala_version }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '8'
cache: 'sbt'
cache-dependency-path: 'build.sbt'

- name: Install Conda
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: python/environment.yml
conda-solver: libmamba
activate-environment: glow

- name: Scala tests
run: sbt core/test exit

- name: Python tests
run: sbt python/test exit

- name: Docs tests
run: sbt docs/test exit

0 comments on commit b5d91b8

Please sign in to comment.